Flutter AAB works with Internal App Sharing but crashes when installed from Google Play Closed Testing


I have a Flutter app that works correctly in debug and release mode. The same AAB also works when installed through Google Play Internal App Sharing.

However, when I install the app from the Closed Testing track, it crashes immediately during startup.

The crash log shows:

FATAL EXCEPTION: main
Process: com.amanidev.luma

java.lang.RuntimeException:
Unable to get provider androidx.startup.InitializationProvider

Caused by:
java.lang.RuntimeException:
Failed to create an instance of androidx.work.impl.WorkDatabase

My configuration:

Flutter: 3.44.8
compileSdk: 36
targetSdk: 36
minSdk: 24

The app uses google_mobile_ads.

I added this dependency to android/app/build.gradle.kts:

dependencies {
    implementation("androidx.work:work-runtime:2.11.2")
}

My release configuration is:

buildTypes {
    release {
        signingConfig = signingConfigs.getByName("lumaUpload")

        isMinifyEnabled = true
        isShrinkResources = true

        proguardFiles(
            getDefaultProguardFile("proguard-android-optimize.txt"),
            "proguard-rules.pro"
        )
    }
}

My proguard-rules.pro contains:

-keep class * extends androidx.room.RoomDatabase {
    <init>();
}

-keep class androidx.work.impl.WorkDatabase { *; }
-keep class androidx.work.impl.WorkDatabase_Impl { *; }

The corrected build has a higher version code, and the AAB works through Internal App Sharing, but the Closed Testing installation still crashes.

Why would the same AAB work through Internal App Sharing but crash through Closed Testing? Could Google Play still be serving an older bundle, or is there another R8/WorkManager configuration required?

Tags:

flutter android google-play-console r8 android-workmanager
0
Nov 25 at 5:05 PM
User Avataramani toama
#android#flutter#google-play#google-play-console

No answer found for this question yet.