Android怎么添加licence,设置dexguard许可文件在Android Studio中

自从有了一个更新的答案之后已经有一段时间了,所以我想我会更新,因为对DexGuard的许可证文件设置进行了更改。

我刚刚从Android Studio版本从2.2.3更新到2.3,并将我的Gradle版本从2.14.1升级到3.3。在升级到摇篮3.3版,我收到了由OP记载了同样的错误:

Can't find a DexGuard license file.

You should place your license file dexguard-license.txt

1) in a location defined by the Java system property 'dexguard.license',

2) in a location defined by the OS environment variable 'DEXGUARD_LICENSE',

3) in your home directory,

4) in the class path, or

5) in the same directory as the DexGuard jar.

我DexGuard配置是工作得很好用摇篮版本2.14.1我dexguard-license.txt文件在同一目录作为DexGuard jar(建议#5)。

事实证明,对于DexGuard的文件规定如下:

Note: when using Gradle 3.1+, the license file will not be found anymore when placed in the same directory as the DexGuard plugin jar.

(来源:DexGuard 7.3.10文件 - >快速开始 - >设置许可文件)

我想将我的许可证文件保存在DexGuard jar相同的目录中,因此我实施了建议#1。

systemProp.dexguard.license=./app/libs/Dexguard_7_3_10

注意,我DexGaurd罐子和我dexguard-LICENSE.TXT文件位于以下目录::我通过添加下面一行到我的项目的gradle.properties文件,这样做{项目文件夹} /应用/ libs/DexGuard_7_3_10/

我采用这种解决方案,因为我不仅在本地构建,而且在Jenkins CI上构建。此解决方案使我无需在构建服务器本身上实施任何更改(即本地环境变量,将文件复制到服务器主目录或类路径选项)。我希望这可以帮助别人解决这个问题,并发现错误信息令人困惑。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值