fix(proguard): keep no-arg constructor of Room *_Impl classes
R8 in playBenchmark (minifyEnabled) stripped the no-arg <init> from WorkDatabase_Impl because -keepnames preserves names but not members. Room instantiates generated *_Impl subclasses reflectively via Class.getDeclaredConstructor(), so startup crashed with NoSuchMethodException in androidx.startup.InitializationProvider. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Vendored
+6
@@ -63,3 +63,9 @@
|
||||
-keep class com.vitorpamplona.quartz.** { *; }
|
||||
-keep class com.vitorpamplona.amethyst.** { *; }
|
||||
-keep class com.vitorpamplona.ammolite.** { *; }
|
||||
|
||||
# Room generates *_Impl subclasses instantiated reflectively via no-arg constructor.
|
||||
# -keepnames preserves the name but R8 still strips the unused <init>().
|
||||
-keep class * extends androidx.room.RoomDatabase {
|
||||
<init>();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user