Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

在一次编译过程中发现有以下提示:

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings

大概意思就是当前的版本有些api会在gradle8.0中移除。详情可以使用命令行--warning-mode all进行查看。
所以在终端执行以下命令:

gradle --warning-mode all

得到以下结果:

rockey211119@rockey211119s-MacBook-Pro RockeyClean % gradle --warning-mode all 
Starting a Gradle Daemon (subsequent builds will be faster)
The RepositoryHandler.jcenter() method has been deprecated. This is scheduled to be removed in Gradle 8.0. JFrog announced JCenter's sunset in February 2021. Use mavenCentral() instead. Consult the upgrading guide for further information: https://docs.gradle.org/7.3/userguide/upgrading_version_6.html#jcenter_deprecation
        at settings_ced5934gp3ys17aor5yf3drv7$_run_closure1$_closure2.doCall(/Users/rockey211119/Documents/Android/AndroidWorkSpace/RockeyClean/settings.gradle:6)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)

> Configure project :app
WARNING:The option setting 'android.enableR8.fullMode=true' is experimental.
The current default is 'false'.

> Task :help

Welcome to Gradle 7.3.

To run a build, run gradle <task> ...

To see a list of available tasks, run gradle tasks

To see more detail about a task, run gradle help --task <task>

To see a list of command-line options, run gradle --help

For more detail on using Gradle, see https://docs.gradle.org/7.3/userguide/command_line_interface.html

For troubleshooting, visit https://help.gradle.org

BUILD SUCCESSFUL in 6s
1 actionable task: 1 executed

根据提示知道RepositoryHandler.jcenter()函数将在gradle8.0被移除。需要使用mavenCentral()替换。
搜索全局jcenter()。通常都在build.gradle文件中。进行替换。不过通常会出现问题,因为这是个依赖仓库,有些仓库还没有迁移到maven。所以可能会出问题。剩下的就根据具体问题进行具体解决

  • 7
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值