记录遇到过的问题
1、Connetction refused (Connection refused)
问题可能是你之前设置过代理,As就把你的代理配置缓存到了gradle.properties文件中了,每次编译的时候都会读取这个配置,所以即使你去掉代理也是不行的,你要把gradle.properties的中的代理设置去掉。
- 在设置中,把代理设置去掉
- 项目下的gradle.properties看看是否存在代理设置
- Android .gradle目录下的gradle.properties文件中是否有代理,查看方法是在命令行中执行 open .gradle,打开gradle.properties文件。
- 如果你找不到这个文件就把bulid文件删掉重新编译试试
2、Failed to transform file ‘xxxxx.jar’ to match attributes {artifactType=android-classes, org.gradle.usage=java-runtime-jars}
你所依赖的jar包或者其他第三方库不存在或者不正确。这个错误其很简单,就是你引用的jar包路径错了、版本错了或者不存在,检查一下改改就行了
3、Cannot create variant ‘android-aidl’ after configuration’:xxxxx:debugApiElements’ has been resolved
module中有
classpath = files(variant.javaCompile.classpath.files, project.android.getBootClasspath())
用dofirst{}包裹起来
doFirst {
classpath = files(variant.javaCompile.classpath.files, project.android.getBootClasspath())
}