1. Check it's the same problem
It's the same issue if all of these are true:
The crash says Failed to create an instance of androidx.work.impl.WorkDatabase.
It only crashes in the release build. The debug build works.
minifyEnabled true is set under release in app/build.gradle.
The app uses an old Room version, often pulled in by AdMob (play-services-ads). To see which version, run this in Android Studio's Terminal:
gradlew :app:dependencies --configuration releaseRuntimeClasspath
Search the output for androidx.room:room-runtime. A version older than about 2.6 (for example 2.2.5) means it's the same problem.
2. Fix it
Open app/proguard-rules.pro in the other app and add these lines at the end:
# Keep Room database constructors (fixes WorkDatabase startup crash with R8)
-keep class * extends androidx.room.RoomDatabase {
<init>();
}
Save the file. No other changes are needed: no code changes, no dependency changes, and no data deleted.
3. Rebuild
In Android Studio:
Run Build → Clean Project.
Set Build → Select Build Variant to release.
Run Build → Generate Signed Bundle / APK with that app's release key.
4. Test it
Install the release build on a phone and open it. Testing with the normal Run button only checks the debug build, and debug never had this crash.
It worked if:
the app opens past the splash screen, and
Logcat (filter: package:your.package.name) has no FATAL EXCEPTION and no WorkDatabase error.
Then upload the new .aab to Play Console. Testing it on internal testing first is safest.
If it still crashes
Different message (for example cannot find implementation for … WorkDatabase): this is a different cause. Send me the full crash log.
Alternative fix: instead of the rule, add a newer WorkManager to dependencies in app/build.gradle. It brings a newer Room that already includes this rule:
implementation 'androidx.work:work-runtime:2.10.1'
Then rebuild and test the same way. This is a bigger change, so try the rule first.
If you open the other app's folder here, I can check it and apply the fix for you.
Failed to create an instance of androidx.work.impl.WorkDatabase.
Reviewed by Md Shahinur Islam
on
October 28, 2026
Rating:
No comments: