首页 > 解决方案 > 无法解决依赖 Android Studio

问题描述

我在构建项目时遇到问题。我收到了这个错误:

感谢您的帮助:D

在 0 秒内配置成功错误:无法解析“:uhabits-android@debugAndroidTest/compileClasspath”的依赖关系:无法解析 com.squareup:javawriter:2.1.1。显示详细信息 受影响的模块:uhabits-android

错误:无法解析 ':uhabits-android@debugAndroidTest/compileClasspath' 的依赖关系:无法解析 com.squareup:javawriter:2.5.1。显示详细信息 受影响的模块:uhabits-android

错误:无法解析 ':uhabits-android@debugAndroidTest/compileClasspath' 的依赖关系:无法解析 com.squareup:javawriter:2.1.1。显示详细信息 受影响的模块:uhabits-android

标签: androidmoduledependencies

解决方案


在 app 模块 build.gradle 中添加以下依赖项

dependencies {
compile 'com.squareup:javawriter:2.5.1'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'} 

并使用

repositories {
    mavenCentral()
}

推荐阅读