我正在尝试在Android Studio中运行简单的Hello World应用程序但是Gradle无法解决依赖关系。
> Could not resolve all dependencies for configuration':app:_debugAndroidTestApkCopy'.> Could not resolve com.squareup:javawriter:2.1.1.
Required by:
MyApplication:app:unspecified > com.android.support.test.espresso:espresso-core:2.2.2
> Could not resolve com.squareup:javawriter:2.1.1.
> Could not get resource 'https://jcenter.bintray.com/com/squareup/javawriter/2.1.1/javawriter-2.1.1.pom'.
类似错误堆栈中出现更多错误
答案 0 :(得分:0)
您需要在app模块build.gradle中添加以下依赖项;
dependencies {
compile 'com.squareup:javawriter:2.5.1'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'}
并使用;
repositories {
mavenCentral()
}
而不是项目级build.gradle中的jcenter(),这将解决gradle依赖项。