下載了Android Studio 3.1.4,新建一個項目,選擇Activity,結果gradle提示
Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not download junit.jar (junit:junit:4.12) Open File Show Details Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not download junit.jar (junit:junit:4.12) Open File Show Details Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not download junit.jar (junit:junit:4.12) Open File Show Details
解決方法
1、下載junit
點擊 https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.jar,放在...\Android Studio\gradle\gradle-4.4\lib\plugins中,並重啟Android Studio。
不過這個plugins都會有junit包的。
2、注釋bulid.gradle中的junit行,看圖,順便注釋一下 androidTestImplementation。