From ac1b1973369e67b15a2e3f9a1e1d9d6ba989a351 Mon Sep 17 00:00:00 2001 From: davotoula Date: Thu, 23 Apr 2026 13:11:49 +0200 Subject: [PATCH] fix(proguard): keep no-arg constructor of Room *_Impl classes R8 in playBenchmark (minifyEnabled) stripped the no-arg 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) --- amethyst/proguard-rules.pro | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/amethyst/proguard-rules.pro b/amethyst/proguard-rules.pro index 830dc4248..e730119cc 100644 --- a/amethyst/proguard-rules.pro +++ b/amethyst/proguard-rules.pro @@ -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 (). +-keep class * extends androidx.room.RoomDatabase { + (); +}