R8 full mode#198
Conversation
mmathieum
commented
Apr 20, 2026
- R8 full mode commons-android#120
- R8 full mode commons#691
Qodana for JVMIt seems all right 👌 No new problems were found according to the checks applied ☁️ View the detailed Qodana report Contact Qodana teamContact us at qodana-support@jetbrains.com
|
There was a problem hiding this comment.
Code Review
This pull request refactors the ProGuard configuration by consolidating attribute preservation rules and removing specific configurations for OKHTTP, Retrofit, and InMobi. Feedback highlights that removing Retrofit rules is risky and could lead to runtime exceptions if the project still relies on it. Additionally, redundant attribute declarations were identified in the Crashlytics section.
I am having trouble creating individual review comments. Click here to see my feedback.
app-android/proguard-rules.pro (60-99)
The removal of the Retrofit-specific ProGuard rules is risky when enabling R8 full mode. R8 full mode is more aggressive and often requires these specific -if interface and -keep rules to prevent the stripping of generic signatures and interfaces used by Retrofit's dynamic proxies. If the project still uses Retrofit, removing these rules may cause runtime exceptions (e.g., IllegalArgumentException regarding service method return types). Please ensure these rules are either provided by the library's consumer ProGuard configuration or are indeed no longer needed.
app-android/proguard-rules.pro (9-13)
The -keepattributes SourceFile,LineNumberTable directive is redundant here because these attributes are already included in the consolidated list on line 4. Removing this duplicate entry keeps the configuration clean and avoids confusion.
# CRASHLYTICS - START
# https://firebase.google.com/docs/crashlytics/android/get-deobfuscated-reports#config-r8-proguard-dexguard
-keep public class * extends java.lang.Exception # Optional: Keep custom exceptions.
# CRASHLYTICS - END
There was a problem hiding this comment.
Pull request overview
Updates the app’s ProGuard/R8 configuration in support of running with R8 full mode, simplifying legacy rules and aligning keep/dontwarn entries with current SDK guidance.
Changes:
- Consolidates and expands
-keepattributesto retain additional metadata used by reflection/annotations. - Updates Crashlytics and Facebook Audience Network ProGuard rules to match current documentation.
- Removes legacy/duplicate ProGuard sections (e.g., older OkHttp/Retrofit/InMobi-related blocks).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.