解决AndResGuard在gradle 7.0上报错的问题

当升级Android Studio至AreticFox并更新Gradle到7.0时,AndResGuard遇到兼容性错误。为解决此问题,需要下载AndResGuard源码,升级Gradle版本,将`compile`改为`implementation`,添加`@Internal`注解到相关代码,修改版本号为1.2.22,并通过特定命令发布到本地Maven。源码已上传至GitHub,无需升级Gradle到7.0也可使用,因为`@Internal`从3.0版本起就可用。

当Android Studio升级到Aretic Fox版本后,APG的版本也升级到了7.0,而gradle的版本也要随之升级到7.0了(参考官方文档

AndResGuard在gradle升级到7.0后会出现错误,如下

Some problems were found with the configuration of task ':app:resguardProdRelease' (type 'AndResGuardTask').
  - In plugin 'AndResGuard' type 'com.tencent.gradle.AndResGuardTask' property 'android' is missing an input or output annotation.

看错误是没有适配gradle 7.0的,我们着手修改这个问题。
下载源码,按以下步骤修改
1、升级gradle版本到7.0
2、compile改为implementation
3、修改AndResGuardT

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值