android6-5 Exercise 1: R8 on release ================================= // app/build.gradle.kts: shrink, obfuscate and optimise the RELEASE build android { buildTypes { release { isMinifyEnabled = true // R8: shrink, obfuscate, optimise code isShrinkResources = true // needs isMinifyEnabled = true (docs) proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), // not the older proguard-android.txt (docs) "proguard-rules.pro" // your own keep rules ) } } } // Newer AGP (docs: 9.3 and higher) has an optimization { enable = true } block and keep rules in // src//keepRules as .keep files. Check which one your AGP uses before copying either form. # proguard-rules.pro: add rules only when the release build breaks, and keep them narrow # Example shape (general knowledge): keep a class that is created by reflection -keep class com.example.notes.data.RemoteNoteDto { *; } Steps: Build > Generate Signed App Bundle or APK (or the release variant from Build Variants), install the release build, use every screen, read Logcat for crashes such as ClassNotFoundException or missing fields (typical for reflection or serialization). Fix with the narrowest -keep rule that names the one class involved. Report your AGP version and the DSL form (isMinifyEnabled or the newer optimization block, which the docs say needs .keep files in src//keepRules). Keep the mapping.txt for the build (general knowledge). Code unrun.