From the course: Distributing Your Android App for Kotlin Developers
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Minify the app with R8 - Android Tutorial
From the course: Distributing Your Android App for Kotlin Developers
Minify the app with R8
- [Instructor] One of the last things you should do before distributing your application is enable code and resource shrinking. The Android SDK comes packaged with a tightly integrated tool called R8 that is used to do exactly this. Doing this will reduce the final size of your application package and make it harder to decompile and read your code. Android used to use pro guard but this was replaced with R8 in 2018. In Android Studio, in the application, modules, build.gradle file, you can turn on code and resource shrinking by setting the minify enabled property to true. This is in the release build types section right above the line that specifies the pro guard configuration files that are used by R8. I have already adjusted this in the sample app. This will instruct the compiler to detect and remove unused classes, fields, methods, and attributes from your packaged application including those from reference…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Explore the sample app2m 41s
-
(Locked)
Clean up your code5m 53s
-
(Locked)
Manage the app version3m 8s
-
(Locked)
Minify the app with R82m 40s
-
(Locked)
Configure build types2m 40s
-
(Locked)
Configure multiple app flavors6m 30s
-
(Locked)
Create build variants4m 29s
-
(Locked)
Build signed packages8m 10s
-
-
-
-
-