Could not resolve com.android.tools.lint:lint-kotlin:26.2.0.

2023-07-10,,

好久没有使用weexplus publish android 打包apk, 今一运行失败了,提示Could not resolve com.android.tools.lint:lint-kotlin:26.2.0.

错误日志:


Download https://maven.google.com/com/android/tools/lint/lint-checks/26.2.0/lint-checks-26.2.0.pom
Download https://maven.google.com/com/android/tools/lint/lint-api/26.2.0/lint-api-26.2.0.pom
:farwolf:extractReleaseAnnotations FAILED Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.6/userguide/command_line_interface.html#sec:command_line_warnings
137 actionable tasks: 11 executed, 126 up-to-date
FAILURE: Build failed with an exception. * What went wrong:
Could not resolve all files for configuration ':farwolf:lintClassPath'.
> Could not resolve com.android.tools.lint:lint-kotlin:26.2.0.
Required by:
project :farwolf > com.android.tools.lint:lint-gradle:26.2.0 > com.android.tools.lint:lint:26.2.0
project :farwolf > com.android.tools.lint:lint-gradle:26.2.0 > com.android.tools.lint:lint:26.2.0 > com.android.tools.lint:lint-checks:26.2.0 > com.android.tools.lint:lint-api:26.2.0
> Could not resolve com.android.tools.lint:lint-kotlin:26.2.0.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/lint/lint-kotlin/26.2.0/lint-kotlin-26.2.0.jar'.
> Could not HEAD 'https://jcenter.bintray.com/com/android/tools/lint/lint-kotlin/26.2.0/lint-kotlin-26.2.0.jar'.
> Read timed out
> Could not resolve com.google.errorprone:error_prone_annotations:2.0.18.
Required by:
project :farwolf > com.android.tools.lint:lint-gradle:26.2.0 > com.android.tools.lint:lint:26.2.0 > com.google.guava:guava:23.0
> Skipped due to earlier error * Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

看这个提示就知道是Could not resolve com.android.tools.lint:lint-kotlin:26.2.0. 错误了,于是我顺着这个找了半天,gradle也去逛了半天没结果

也有朋友

说这么干,但是我没还是没整对…


最后用as将项目目录下platforms\android下对应的项目导入(我这是portal-app\platforms\android\portal-app), 然后File>Sync Project with Gradle Files 跑maven去download 半天在那里,最后看到了run tasks success


好了这次再回到cmd中去weexplus publish android

终于看到了久违的 BUILD SUCCESSFUL

经过上面折腾初步断定是由于Download https://maven.google.com/com/android/tools/lint/lint-api/26.2.0/lint-api-26.2.0.pom 失败而引起的依赖丢失,build failed

而经过多次cmd build尝试,觉得cmd 中直接到google download 还是不如as 有威力呀,as 直接一次就download好了所有,而cmd 中总是会有超时。

ok 搞定,记录,避免下次遇到有不知从何着手

其他请参考weexplus build官网

Could not resolve com.android.tools.lint:lint-kotlin:26.2.0.的相关教程结束。

《Could not resolve com.android.tools.lint:lint-kotlin:26.2.0..doc》

下载本文的Word格式文档,以方便收藏与打印。