You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(android): add SourceFile/LineNumberTable attrs and tighten lifecycle dontwarn
- Add -keepattributes SourceFile,LineNumberTable so R8 preserves line
numbers in the mapping file; without this crash stack traces show
"Unknown Source" even after deobfuscation, defeating the PR's purpose
- Remove redundant GeneratedPluginRegistrant keep rule (covered by
the io.flutter.** wildcard)
- Scope -dontwarn androidx.lifecycle.** to the specific optional
interface (DefaultLifecycleObserver) rather than suppressing all
lifecycle warnings
- Update docs to document both Firebase Crashlytics and Play Console
as mapping file destinations, and fix the retrace command to use
the actual Android SDK path instead of a placeholder
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Currently, ProGuard/R8 is **enabled** (`minifyEnabled = true`). This reduces app size and generates a deobfuscation mapping file that is automatically uploaded to Google Play Console, making crash analysis easier.
694
+
Currently, ProGuard/R8 is **enabled** (`minifyEnabled = true`). This reduces app size and generates a deobfuscation mapping file that is uploaded to two destinations automatically:
695
+
696
+
-**Firebase Crashlytics** — uploaded during the Gradle build by the `firebase-crashlytics-gradle` plugin (`uploadCrashlyticsMappingFileRelease` task). Crash reports in the Firebase Console are deobfuscated automatically.
697
+
-**Google Play Console** — uploaded by the CI release workflow (`release-android.yml`) after the AAB build. ANRs and crashes reported via Play Console are deobfuscated automatically.
695
698
696
699
### Why Enable ProGuard/R8?
697
700
@@ -725,39 +728,26 @@ buildTypes {
725
728
Create `android/app/proguard-rules.pro`:
726
729
727
730
```proguard
728
-
# Flutter wrapper
729
-
-keep class io.flutter.app.** { *; }
730
-
-keep class io.flutter.plugin.** { *; }
731
-
-keep class io.flutter.util.** { *; }
732
-
-keep class io.flutter.view.** { *; }
733
-
-keep class io.flutter.** { *; }
734
-
-keep class io.flutter.plugins.** { *; }
735
-
736
-
# Preserve Flutter plugin registrant
737
-
-keep class io.flutter.plugins.GeneratedPluginRegistrant { *; }
731
+
# Flutter wrapper classes
732
+
-keep class io.flutter.** { *; }
738
733
739
734
# Keep native methods
740
735
-keepclassmembers class * {
741
736
native <methods>;
742
737
}
743
738
744
-
# Gson/JSON serialization (if using)
739
+
# Preserve source file names and line numbers for actionable crash stack traces
740
+
-keepattributes SourceFile,LineNumberTable
745
741
-keepattributes Signature
746
742
-keepattributes *Annotation*
747
-
-keep class com.google.gson.** { *; }
748
-
749
-
# url_launcher
750
-
-keep class io.flutter.plugins.urllauncher.** { *; }
751
-
752
-
# shared_preferences
753
-
-keep class io.flutter.plugins.sharedpreferences.** { *; }
743
+
-keepattributes InnerClasses
744
+
-keepattributes EnclosingMethod
754
745
755
-
# cached_network_image
756
-
-keep class com.example.cached_network_image.** { *; }
0 commit comments