I'm using 'androidx.multidex:multidex:2.0.0'
and I'm pointing to the MultiDexApplication class from the manifest using:
<application
android:name="androidx.multidex.MultiDexApplication"
...
On the build.gradle I also added the follwoing entry:
defaultConfig {
...
multiDexEnabled true
...
When running the application in Android versions older than 5.0 (API 21) I get the following exception:
java.lang.RuntimeException: Unable to instantiate application androidx.multidex.MultiDexApplication: java.lang.ClassNotFoundException: Didn't find class "androidx.multidex.MultiDexApplication" on path [...]
I used the APK browser and I saw that the MultiDexApplication class and the other MultiDex helper classes where in the classes2.dex file. That's probably why it does'nt find the class.
Must I force those classes to be on the main classes.dex file? How can this be fixed?