Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix "dalvik.system.BaseDexClassLoader.findClass (BaseDexClassLoader.java:134)"

After I upgraded to the 64-bit armeabi library and released the app to googleplay in bundle packaging, I encountered the following problems in googleplay crashes report page:

java.lang.RuntimeException: 
  at android.app.ActivityThread.handleReceiver (ActivityThread.java:3982)
  at android.app.ActivityThread.access$2300 (ActivityThread.java:273)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2050)
  at android.os.Handler.dispatchMessage (Handler.java:112)
  at android.os.Looper.loop (Looper.java:216)
  at android.app.ActivityThread.main (ActivityThread.java:7625)
  at java.lang.reflect.Method.invoke (Method.java)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:524)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:987)
Caused by: java.lang.ClassNotFoundException: 
  at dalvik.system.BaseDexClassLoader.findClass (BaseDexClassLoader.java:134)
  at java.lang.ClassLoader.loadClass (ClassLoader.java:379)
  at java.lang.ClassLoader.loadClass (ClassLoader.java:312)
  at android.app.AppComponentFactory.instantiateReceiver (AppComponentFactory.java:84)
  at android.support.v4.app.CoreComponentFactory.instantiateReceiver (CoreComponentFactory.java:56)
  at android.app.ActivityThread.handleReceiver (ActivityThread.java:3975)
  at android.app.ActivityThread.access$2300 (ActivityThread.java:273)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2050)
  at android.os.Handler.dispatchMessage (Handler.java:112)
  at android.os.Looper.loop (Looper.java:216)
  at android.app.ActivityThread.main (ActivityThread.java:7625)
  at java.lang.reflect.Method.invoke (Method.java)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:524)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:987)

It's only appear on the Android 9 devices

I turn off the R8 in my leatest release version app.But it's appear just like before.Problem still happen

wish your help

like image 204
user2811667 Avatar asked Aug 22 '19 01:08

user2811667


1 Answers

add this to gradle.build:

defaultConfig {
...
minSdkVersion 14
targetSdkVersion // your version 
...

// Enabling multidex support.
multiDexEnabled true
}

dependencies {
  compile 'com.android.support:multidex:1.0.0'
}
  • follow android developers page's instruction: https://developer.android.com/studio/build/multidex.html
like image 86
Anas Mehar Avatar answered Oct 18 '22 00:10

Anas Mehar