Unity-Technologies / com.unity.mobile.notifications

Mobile Notifications Package
https://docs.unity3d.com/Packages/com.unity.mobile.notifications@2.1/manual/index.html
Other
132 stars 42 forks source link

[Android] Unhandled android.content.res.Resources$NotFoundException on app start #193

Closed abogarsukov-braingames closed 2 years ago

abogarsukov-braingames commented 2 years ago

Hello,

The crash appears to happen on the app start. Firebase Crashlytics indicates it happens when the app is in background, Android 7 only.

Android 7 Notifications v2.0.2 Unity 2020.3.29

Caused by android.content.res.Resources$NotFoundException: failed to add asset path /data/app/com.XXX.YYY-1/base.apk
       at android.app.ResourcesManager.createAssetManager(ResourcesManager.java:281)
       at android.app.ResourcesManager.createResourcesImpl(ResourcesManager.java:359)
       at android.app.ResourcesManager.getOrCreateResources(ResourcesManager.java:638)
       at android.app.ResourcesManager.getResources(ResourcesManager.java:730)
       at android.app.ActivityThread.getTopLevelResources(ActivityThread.java:2041)
       at android.app.LoadedApk.getResources(LoadedApk.java:787)
       at android.app.ContextImpl.<init>(ContextImpl.java:2245)
       at android.app.ContextImpl.createApplicationContext(ContextImpl.java:1929)
       at android.content.ContextWrapper.createApplicationContext(ContextWrapper.java:858)
       at android.content.ContextWrapper.createApplicationContext(ContextWrapper.java:858)
       at android.app.Notification$Builder.recoverBuilder(Notification.java:3885)
       at com.unity.androidnotifications.UnityNotificationUtilities.recoverBuilder(UnityNotificationUtilities.java:517)
       at com.unity.androidnotifications.UnityNotificationManager.getNotificationOrBuilderForIntent(UnityNotificationManager.java:879)
       at com.unity.androidnotifications.UnityNotificationManager.onReceive(UnityNotificationManager.java:674)
       at android.app.ActivityThread.handleReceiver(ActivityThread.java:3309)
       at android.app.ActivityThread.-wrap20(ActivityThread.java)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1715)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:154)
       at android.app.ActivityThread.main(ActivityThread.java:6682)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1534)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1424)
cookapps-jhlee8 commented 2 years ago

A lot of the same issues happen only android 7

korober commented 2 years ago

Same issues for my users, common conditions: Android 7 & Device Vendor: Samsung

abogarsukov-braingames commented 2 years ago

There is another issue with the workaround for this: https://github.com/Unity-Technologies/com.unity.mobile.notifications/issues/196. Closing this one.