jiangxincode / DroidDemo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deprecated Gradle features were used in this build

jiangxincode opened this issue · comments

commented

正常编译出现如下警告:

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/7.0.2/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 2s

按照提示修改编译参数,并将日志导出到文件:

.\gradlew.bat assemble --warning-mode all > build_202207162135.log

告警如下:

> Configure project :
The RepositoryHandler.jcenter() method has been deprecated. This is scheduled to be removed in Gradle 8.0. JFrog announced JCenter's shutdown in February 2021. Use mavenCentral() instead. Consult the upgrading guide for further information: https://docs.gradle.org/7.0.2/userguide/upgrading_version_6.html#jcenter_deprecation
	at build_ai2cd6dp4matodw19gy3hmyps$_run_closure1$_closure2.doCall(D:\Code\Android\DroidDemo\build.gradle:8)
	(Run with --stacktrace to get the full stack trace of this deprecation warning.)

build_202207162135.log

参考: https://docs.gradle.org/7.0.2/userguide/upgrading_version_6.html#jcenter_deprecation,使用mavenCentral替换jcenter,并重新编译,报错如下:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugAidl'.
> Could not resolve all files for configuration ':app:debugCompileClasspath'.
   > Could not resolve com.github.promeg:tinypinyin-lexicons-android-cncity:2.0.3.
     Required by:
         project :app
      > Could not resolve com.github.promeg:tinypinyin-lexicons-android-cncity:2.0.3.
         > Could not get resource 'https://jitpack.io/com/github/promeg/tinypinyin-lexicons-android-cncity/2.0.3/tinypinyin-lexicons-android-cncity-2.0.3.pom'.
            > Could not HEAD 'https://jitpack.io/com/github/promeg/tinypinyin-lexicons-android-cncity/2.0.3/tinypinyin-lexicons-android-cncity-2.0.3.pom'. Received status code 401 from server: Unauthorized
   > Could not find com.zhy:base-rvadapter:3.0.3.
     Required by:
         project :app
   > Could not find com.zhy:base-adapter:3.0.3.
     Required by:
         project :app

* 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.

* Get more help at https://help.gradle.org

BUILD FAILED in 5s

fixed by fffa985 and 6afd01e