Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Didn't find class “androidx.multidex.MultiDexApplication” on path: DexPathList on lower API <= 19 devices

I'm trying to add Multidex support to my app. But I get an error:

java.lang.RuntimeException: Unable to instantiate activity ComponentInfo: java.lang.ClassNotFoundException: Didn't find class "androidx.multidex.MultiDexApplication" on path: DexPathList[[zip       file "/data/app/com.dfn.partner-2.apk"],nativeLibraryDirectories[/data/app-lib/se.android-2, /vendor/lib, /system/lib]]

My gradle have:

defaultConfig {
   multiDexEnabled true
}

and

depenencies {
   ...
   implementation 'androidx.multidex:multidex:2.0.1'
   ...
}

My AndroidManifest.xml have :

<application
  android:name="androidx.multidex.MultiDexApplication"
  ... >
...
</application>

What could be wrong?

like image 486
Vladyslav Panchenko Avatar asked Jan 24 '19 15:01

Vladyslav Panchenko


2 Answers

I got this error after adding multidex until I cleaned:

./gradlew clean

like image 69
weston Avatar answered Sep 26 '22 02:09

weston


I cleaned the project:

Build -> Clean Project

and then I went to:

File -> Invalidate Caches / Restart

Compile, now should work!

like image 28
itzo Avatar answered Sep 26 '22 02:09

itzo