2016-08-03 25 views
0

,当我试图运行一个简单的程序,我得到了有关摇篮的错误:固定运行时间错误的版本的Android计划

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) 我的模块装配gradle这个包含这些代码:

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' 
    } 
+0

分享你的模块gradle文件。 – Shaishav

+0

@Shaishav,Sry我刚刚开始学习Android,我是初学者,我该如何分享模块gradle文件? (它到底在哪里?) – MarAnd

+0

如果你在Android Studio上,那么应该在项目的 – Shaishav

回答

0

有问题的部分与gralde.build是这一行:

testCompile 'junit:junit:4.12' 

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

相关问题