mac 平台 ,Android Studio 版本 4.1.2 ,gradle 版本 6.5 。遇见一个奇怪的问题,打 debug 包没问题,打 release 包就报错:
Execution failed for task ':app:lintVitalRelease'.
> Could not resolve all files for configuration ':app:lintClassPath'.
> Could not download intellij-core-27.1.2.jar (com.android.tools.external.com-intellij:intellij-core:27.1.2)
> Could not get resource 'https://maven.aliyun.com/repository/google/com/android/tools/external/com-intellij/intellij-core/27.1.2/intellij-core-27.1.2.jar'.
> Could not GET 'https://maven.aliyun.com/repository/google/com/android/tools/external/com-intellij/intellij-core/27.1.2/intellij-core-27.1.2.jar'.
> Can't connect to SOCKS proxy:Connection refused (Connection refused)
> Could not download kotlin-compiler-27.1.2.jar (com.android.tools.external.com-intellij:kotlin-compiler:27.1.2)
> Could not get resource 'https://maven.aliyun.com/repository/google/com/android/tools/external/com-intellij/kotlin-compiler/27.1.2/kotlin-compiler-27.1.2.jar'.
> Could not GET 'https://maven.aliyun.com/repository/google/com/android/tools/external/com-intellij/kotlin-compiler/27.1.2/kotlin-compiler-27.1.2.jar'.
> Can't connect to SOCKS proxy:Connection refused (Connection refused)
报错信息里的 jar 包都是可以通过浏览器下载的,很奇怪...
解决方案,在配置文件里加入以下配置:
Android {
lintOptions {
checkReleaseBuilds false
abortOnError false
}
}