本文方法大多是来自大佬们的解答,我就是萌新一个,如有冒犯希望大佬手下留情(打可以,轻点0·0)*
1.SDK更新
科学上网有剧毒,代理没啥用、改了host也没用,然后把host文件修改为原始状态后我又能更新了。。。。。
方法:
在Android Studio中的Settings>>System ettings>>HTTP Proxy中将代理设置为none。如果之前修改过系统的host文件,将host文件修改为原始状态
2.新建项目时出现Unable to resolve dependency for ‘:app@debug/compileClasspath’: Could not resolve com.android.suppor
描述:Unable to resolve dependency for ‘:app@debug/compileClasspath’: Could not resolve com.android.support:appcompat-v7:28.0.2.Open FileShow Details
Unable to resolve dependency for ‘:app@debug/compileClasspath’: Could not resolve com.android.support.constraint:constraint-layout:1.1.2.Open FileShow Details
Unable to resolve dependency for ‘:app@debugAndroidTest/compileClasspath’: Could not resolve com.android.support.test?1.0.2.Open FileShow Details等等
方法:干净卸载重装
重装后:
3.新建项目时Failed to resolve: com.android.support:appcompat-v7:28.(这个错误让我很懵逼)
大佬们好像是说这两个不匹配的原因
方法:maven { url "https://maven.google.com" }
这里有详细的说明