5

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.

Thomas Vos
  • 12,271
  • 5
  • 33
  • 71
  • 1
    Could you please file a bug here? https://issuetracker.google.com/issues/new?component=398856&template=1084213 – Pierre May 30 '19 at 13:15
  • 1
    @Pierre I reported the bug: https://issuetracker.google.com/issues/133867457 – Thomas Vos May 30 '19 at 14:11
  • Did you find any answer to this problem @ThomasVos. I am facing the same issue with app bundle sideloading. – Rajat Beck Sep 24 '19 at 12:51
  • @RajatBeck No, unfortunately I have not. I just added a try/catch and ignore the exception because this only happens on the pre-launch report for me. – Thomas Vos Sep 25 '19 at 09:50

0 Answers0