首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >修复Android程序的运行时错误

修复Android程序的运行时错误
EN

Stack Overflow用户
提问于 2016-08-03 22:56:23
回答 1查看 65关注 0票数 0

当我试图运行一个简单的程序时,我得到了一个与Gradle相关的错误:

代码语言:javascript
复制
Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration':app:_debugUnitTestCompile'.
> Could not resolve junit:junit:4.12.
 Required by:
     MyApplication:app:unspecified
  > Could not resolve junit:junit:4.12.
     > Could not get resource 'https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.pom'.
        > Could not GET 'htps://jcenter.bintray.com/junit/junit/4.12/junit-4.12.pom'.
           > Connection to htps://jcenter.bintray.com refused .    

我不知道如何修复它,请帮助。(我目前使用的是android studio 2.1.2版)我的模块build-gradle包含以下代码:

代码语言:javascript
复制
 apply plugin: 'com.android.application'

 android {
compileSdkVersion 23
buildToolsVersion "23.0.3"

defaultConfig {
    applicationId "com.example.n5110.myapplication"
    minSdkVersion 15
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
     }
   }
 }

   dependencies {
       compile fileTree(dir: 'libs', include: ['*.jar'])
       testCompile 'junit:junit:4.12'
       compile 'com.android.support:appcompat-v7:23.3.0'
       compile 'com.android.support:design:23.3.0'
   }
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-08-03 23:33:47

你的gralde.build有问题的部分是下面这一行:

代码语言:javascript
复制
testCompile 'junit:junit:4.12'

这是一个单元测试库。如果你刚刚开始并且可能不会为你的项目编写测试用例,那么你可以通过简单地删除行来解决这个问题。但是,如果您确实需要该库,那么可以参考here

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38747105

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档