我最近从Eclipse
迁移到Android Studio
,我使用Android Studio 1.5.1
。在我开始使用Android Studio之前,我遇到了这个错误:
Failed to resolve: junit:junit:4.12
在Google中搜索并尝试了一些建议的选项后,只有commenting junit test
中的app/build.gradle
解决了问题:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
// testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.android.support:design:23.0.0'
}
但我想知道这是一个很好的安全选项来解决这个问题吗?例如,它将来会引起任何问题吗?
答案 0 :(得分:1)
您需要将以下内容添加到build.gradle
文件中,它应该可以正常工作。
repositories {
maven { url 'http://repo1.maven.org/maven2' }
}