更新到android gradle插件3.5后的proguard问题 [英] proguard problem after updating to android gradle plugin 3.5
问题描述
我将某些对象的json
演示文稿保存为我的应用程序中的缓存.更新应用程序的每个发行版之后,我都没有问题,并且json
对象已正确转换为java对象.更新到android gradle插件3.5(添加此行)后:
I save the json
presentation of some objects as cache in my app. I had no problem after updating each release of the app and json
objects was correctly converted to java objects. After updating to android gradle plugin 3.5 (Adding this line):
classpath 'com.android.tools.build:gradle:3.5.0'
当我创建发行版apk时,似乎无法将json
字符串转换为java对象,并且混淆的名称似乎已更改.当我将其还原到gradle插件3.4.2时,一切正常.那么问题是什么,我该如何解决?
When I create the release apk, It seems that it can't convert the json
string to java objects and it seems that the obfuscated names has changed. When I revert it to gradle plugin 3.4.2, everything is OK. So what is the problem and how can I fix that?
推荐答案
我应该将缓存的对象排除在模糊处理之外,但我暂时禁用了R8
并启用了proguard,方法是将该行添加到gradle.properties
文件中:
I should exclude cached objects from obfuscating but temporarily I disabled R8
and enabled proguard, by adding this line to gradle.properties
file:
android.enableR8=false
并将此行添加到应用程序build.gradle
文件:
And adding this line to app build.gradle
file:
useProguard true
minifyEnabled true
问题解决了.
这篇关于更新到android gradle插件3.5后的proguard问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!