When using R8 on Android, do I need to uninstall my existing Proguard?

雨燕双飞 提交于 2019-12-04 12:33:19

问题


Do I need to remove Proguard related code from Gradle when using R8?

minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'

回答1:


You don't actually remove the proguard rules, as R8 works with Proguard rules in compat mode. For more details, please refer to https://android-developers.googleblog.com/2018/11/r8-new-code-shrinker-from-google-is.html.

R8 is available with Android Studio 3.3 beta and works with Proguard rules. To try it, set the following in your project's gradle.properties file:

android.enableR8=true

But for the full mode, it is not directly compatible with Proguard.


Edit #1

Check here for how to migrate Proguard to R8: Android/java: Transition / Migration from ProGuard to R8?



来源:https://stackoverflow.com/questions/54434047/when-using-r8-on-android-do-i-need-to-uninstall-my-existing-proguard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!