java.lang.ClassNotFoundException: Didn't find class on path: DexPathList only Android 5.0

L

lucas cordeiro

Guest
My app when generating build apk in android 5.0 device release occurs 21 serious errors. I believe it is related to MultiDex.

My build.grale (app)

}
compileSdkVersion 28
buildToolsVersion '26.0.3'
defaultConfig {
applicationId ""
minSdkVersion 21
targetSdkVersion 28
versionCode 87
versionName "1.3.13"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
signingConfig signingConfigs.config
}
buildTypes {
release {
useProguard false
proguardFiles getDefaultProguardFile('proguard-
android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config

}


My Application

class MyApplication : Application() {

private var cacheExpiration: Long = 0 // 6 hours in seconds.

override fun onCreate() {
super.onCreate()

if (LeakCanary.isInAnalyzerProcess(this)) {
// This process is dedicated to LeakCanary for heap analysis.
// You should not init your app in this process.
return
}

LeakCanary.install(this)

val db = Room.databaseBuilder(applicationContext,
AppDatabase::class.java, "database").fallbackToDestructiveMigration().build()
ServiceLocator.database = db

try {
FirebaseApp.initializeApp(this)
val firebaseRemoteConfig = FirebaseRemoteConfig.getInstance()
val configSettings = FirebaseRemoteConfigSettings.Builder()
.setMinimumFetchIntervalInSeconds(600)
.build()
firebaseRemoteConfig.setConfigSettingsAsync(configSettings)
firebaseRemoteConfig.setDefaults(R.xml.remote_config_defaults)

firebaseRemoteConfig.fetch(cacheExpiration).addOnCompleteListener {
if (it.isSuccessful) {
Log.d("FIREBASE", "Remote configurations fetch succeeded")
val debugEndpoint = firebaseRemoteConfig.getString("api_endpoint_debug")
val stagingEndpoint = firebaseRemoteConfig.getString("api_endpoint_staging")
val releaseEndpoint = firebaseRemoteConfig.getString("api_endpoint_release")
Log.d("FIREBASE", debugEndpoint)
Log.d("FIREBASE", stagingEndpoint)
Log.d("FIREBASE", releaseEndpoint)
firebaseRemoteConfig.activate()
} else {
Log.d("FIREBASE", "Remote configurations fetch failed")
}
}

} catch (e: Exception) {
Log.e("FIREBASE-ERROR", "${e.message}")
}
}
}


Stack trace:

11-08 20:00:54.365 3326-3326/E/AndroidRuntime: FATAL EXCEPTION: main
Process:, PID: 3326
java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/util/ArrayMap;
at com.google.firebase.FirebaseApp.<clinit>(com.google.firebase:[email protected]@17.1.0:101)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(com.google.firebase:[email protected]@17.1.0:53)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1686)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1655)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(com.google.firebase:[email protected]@17.1.0:47)
at android.app.ActivityThread.installProvider(ActivityThread.java:4964)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4559)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4499)
at android.app.ActivityThread.access$1500(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1339)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.util.ArrayMap" on path: DexPathList[[zip file "/data/app/br.com.wiseuponline.novawiseup-2/base.apk"],nativeLibraryDirectories=[/vendor/lib64, /system/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at com.google.firebase.FirebaseApp.<clinit>(com.google.firebase:[email protected]@17.1.0:101)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(com.google.firebase:[email protected]@17.1.0:53)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1686)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1655)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(com.google.firebase:[email protected]@17.1.0:47)
at android.app.ActivityThread.installProvider(ActivityThread.java:4964)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4559)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4499)
at android.app.ActivityThread.access$1500(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1339)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
Suppressed: java.lang.ClassNotFoundException: android.support.v4.util.ArrayMap
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 18 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

Continue reading...
 
Top