问题描述
我使用的是Android Studio 3.3 Canary 5,Gradle 4.9,gradle插件3.3.0-alpha05
I use Android Studio 3.3 Canary 5, Gradle 4.9, gradle plugin 3.3.0-alpha05
minifyEnabled true
useProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
不起作用.
@JakeWharton:您为此使用ProGuard配置,而不是Gradle DSL.使用-dontshrink禁用收缩,使用-dontobfuscate禁用混淆,并使用-dontoptimize禁用优化."
@JakeWharton: "You use ProGuard configurations for this, not a Gradle DSL. Disable shrinking with -dontshrink, disable obfuscation with -dontobfuscate, and disable optimization with -dontoptimize."
-dontshrink
-dontobfuscate
-dontoptimize
推荐答案
跟随这个答案,我能够解决此问题.我没有编辑build.gradle
文件,而是将-dontobfuscate
添加到了proguard-rules.pro
文件. (您可以为调试和发布版本配置其他proguard
规则文件.)这跳过了混淆步骤,并允许我使用R8进行精简的调试版本.
Following this answer, I was able to solve this issue. Instead of editing the build.gradle
file, I added -dontobfuscate
to the proguard-rules.pro
file. (You can configure a different proguard
rules file for debug and release builds.) This skipped the obfuscation step and allowed me to make shrink'd debug builds with R8.
这篇关于如何仅关闭Android R8中的混淆处理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!