Skip to content

Commit a3bb309

Browse files
zfdangclaude
andcommitted
fix proguard rules for navigation component crash
R8 was obfuscating Navigator subclasses, breaking @Navigator.Name annotation lookup at runtime and causing crash on app launch. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f91d396 commit a3bb309

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

app/proguard-rules.pro

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,11 @@
5353
-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
5454
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken
5555

56-
##---------------End: proguard configuration for Gson ----------
56+
##---------------End: proguard configuration for Gson ----------
57+
58+
##---------------Begin: proguard configuration for Navigation ----------
59+
# Keep Navigation component classes and their @Navigator.Name annotations
60+
# R8 obfuscates Navigator subclasses, breaking reflection-based lookup
61+
-keep class * extends androidx.navigation.Navigator { *; }
62+
-keep class androidx.navigation.fragment.NavHostFragment { *; }
63+
##---------------End: proguard configuration for Navigation ----------

0 commit comments

Comments
 (0)