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?
I got this error after adding multidex until I cleaned:
./gradlew clean
I cleaned the project:
Build -> Clean Project
and then I went to:
File -> Invalidate Caches / Restart
Compile, now should work!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With