I updated Android studio and if I'm correct the update includes R8 by default to my projects. The question is is r8 only activated by default on new projects or did the update include that change also to my already created project? If not how can I make use of it.
By default, R8 is present in Android Studio. All we need is to enable it. To enable R8, open build. gradle module app file and add this piece of code inside the buildTypes .
What is R8? R8 is an app shrinking tool that is used to reduce the size of your application. This tool present in Android Studio works with the rules of Proguard. R8 will convert your app's code into optimized Dalvik code.
So minifyEnabled removes dead code but does not obfuscate or optimize.
In Android Studio 3.4, R8 is used by default for all projects that don't disable it. You can switch to Proguard with:
android.enableR8 = false
in gradle.properties; oruseProguard = true
in your build.gradle.In Android Studio 3.5, the useProguard flag has no effect. That means that R8 is always used, unless you add android.enableR8=false
in gradle.properties.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With