Unable to resolve dependency for ':app@debug/compileClasspath' could not resolve com.android.support:design:28.0.0

使用AndroidStudio3.2报这个错

Unable to resolve dependency for ':app@debug/compileClasspath' could not resolve com.android.support:design:28.0.0

 

配置

Unable to resolve dependency for ':app@debug/compileClasspath' could not resolve com.android.support:design:28.0.0

 

 解决方法

1)去掉代理

Unable to resolve dependency for ':app@debug/compileClasspath' could not resolve com.android.support:design:28.0.0

gradle目录的下代理属性也 注销掉。
Unable to resolve dependency for ':app@debug/compileClasspath' could not resolve com.android.support:design:28.0.0

Unable to resolve dependency for ':app@debug/compileClasspath' could not resolve com.android.support:design:28.0.0

 

2)项目的gradle设定

Unable to resolve dependency for ':app@debug/compileClasspath' could not resolve com.android.support:design:28.0.0

Unable to resolve dependency for ':app@debug/compileClasspath' could not resolve com.android.support:design:28.0.0

 

3)设定项目的gradle-wrapper.properties的distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip,如果项目更新不下来gradle-4.6-all.zip,就去掉http后面的“S”

Unable to resolve dependency for ':app@debug/compileClasspath' could not resolve com.android.support:design:28.0.0

 

4)设置项目build.gradle的为

classpath ‘com.android.tools.build:gradle:3.2.0‘

maven {
url "https://maven.google.com"
}
 

Unable to resolve dependency for ':app@debug/compileClasspath' could not resolve com.android.support:design:28.0.0

 

5)同步一下

Unable to resolve dependency for ':app@debug/compileClasspath' could not resolve com.android.support:design:28.0.0

 

 6)最后运行结果
Unable to resolve dependency for ':app@debug/compileClasspath' could not resolve com.android.support:design:28.0.0

 



Unable to resolve dependency for ':app@debug/compileClasspath' could not resolve com.android.support:design:28.0.0

上一篇:手机连接ADB连接不上问题


下一篇:每日一问:谈谈 SharedPreferences 的 apply() 和 commit()