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

2

14

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

Fondly answered 22/8, 2019 at 1:55 Comment(4)
So any solution?Connection
I'm still looking for a solution for this!Striper
I'm still looking for a solution too!Generalize
take a look at #53982861Conoid
F
4

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'
}
Footwall answered 22/8, 2019 at 2:9 Comment(3)
Why would multidex help with this issue?Belenbelesprit
@Fondly did you manage to solve it by this answer ? or anyone ?Conoid
I don't think this is a solution since my project has it already enabled. I wasn't able to reproduce the issue though, just 1 crash reported by Crashlytics.Radiative
G
-2

just add the below line of code within the "application" element of AndroidManifest.xml.

`

    <uses-library
        android:name="org.apache.http.legacy"
        android:required="false" />

         ...........
         ..........
</application>

`

Gravante answered 28/10, 2019 at 11:41 Comment(1)
I need a solution for this tooStickinthemud

© 2022 - 2024 — McMap. All rights reserved.