2016-08-03 66 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