Strange crash on samsung devices

This is a strange exception in Samsung phones, in particular the Galaxy S7 Edge, which we noticed in Fabric crash reports:

Fatal Exception: java.lang.RuntimeException: Unable to instantiate receiver com.someapp: java.lang.ClassNotFoundException: Didn't find class "com.someapp" on path: DexPathList[[zip file "/data/app/com.someapp-1/base.apk"],nativeLibraryDirectories=[/data/app/com.someapp-1/lib/arm, /system/fake-libs, /data/app/com.someapp-1/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]
   at android.app.ActivityThread.handleReceiver(ActivityThread.java:3331)
   at android.app.ActivityThread.-wrap20(ActivityThread.java)
   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1734)
   at android.os.Handler.dispatchMessage(Handler.java:102)
   at android.os.Looper.loop(Looper.java:154)
   at android.app.ActivityThread.main(ActivityThread.java:6688)
   at java.lang.reflect.Method.invoke(Method.java)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)

Caused by java.lang.ClassNotFoundException: Didn't find class "com.someapp" on path: DexPathList[[zip file "/data/app/com.someapp-1/base.apk"],nativeLibraryDirectories=[/data/app/com.someapp-1/lib/arm, /system/fake-libs, /data/app/com.someapp-1/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]
   at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
   at android.app.ActivityThread.handleReceiver(ActivityThread.java:3326)
   at android.app.ActivityThread.-wrap20(ActivityThread.java)
   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1734)
   at android.os.Handler.dispatchMessage(Handler.java:102)
   at android.os.Looper.loop(Looper.java:154)
   at android.app.ActivityThread.main(ActivityThread.java:6688)
   at java.lang.reflect.Method.invoke(Method.java)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)

As a feedback to users, this error occurs only when the application is in the background and there is no interaction with it. I think the problem is how the Samsung ROM device tries to minimize background tasks or put them in special memory and our application is not ready, and this is happening.

A point is an exception that does not point to any application class so that we can trace the problem. If someone has encountered this problem before helping, please help!

+6
2

.. ,

compile 'com.android.support:multidex:1.0.1' .

, multiDexEnabled true defaultConfig

    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);
    }
0

Marshmallow Google / Doze.

Android 6.0 (API 23), Android , , , , . Doze , , . App Standby , .

.

Nougat .

, - Doze. , , .

0

Source: https://habr.com/ru/post/1016317/


All Articles