I followed this guide to integrate a check into my app to prevent crashes at runtime when using Android App Bundles (for missing resources).
I added the following code to my application class in the onCreate()
method before the super call:
if (MissingSplitsManagerFactory.create(this).disableAppIfMissingRequiredSplits()) {
// Skip app initialization.
return
}
This works without issues on my own test device. However, if I upload the Android App Bundle to Google Play, some of the devices in the Pre-launch report give this exception:
FATAL EXCEPTION: main
Process: com.example, PID: 25603
java.lang.RuntimeException: Unable to create application com.example.App: java.lang.RuntimeException: Package manager has died
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4858)
at android.app.ActivityThread.access$1600(ActivityThread.java:163)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1423)
at android.os.Handler.dispatchMessage(Handler.java:102)com.example
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5585)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
Caused by: java.lang.RuntimeException: Package manager has died
at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:136)
at Cfa.a(SourceFile)
at com.example.App.onCreate(SourceFile:17)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1014)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4855)
... 8 more
Caused by: android.os.DeadObjectException: Transaction failed on small parcel; remote process probably died
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:503)
at android.content.pm.IPackageManager$Stub$Proxy.getPackageInfo(IPackageManager.java:2215)
at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:131)
... 12 more
After some searching I found out that this issue is not related to the Play Core library, but to the Android package manager. It looks like the Play Core library uses the package manager to check if there are missing splits. I don't know how I can fix this issue as this exception is outside my code, so I would appreciate any help finding a solution.