Search code examples
androidandroid-multidex

Android Multidex support library is disabled


I'm experiencing some problem with multidex support in my app, in fact the app install normally, but through the process, some activities crashed and the app, relaunches the main activity. In logcat I found this :

I/MultiDex: install
I/MultiDex: VM has multidex support, MultiDex support library is disabled.

But I followed recommendations to enable Multidex support :

Gradle :

compileSdkVersion 25
buildToolsVersion '25.0.2'

defaultConfig {
    applicationId "com..company.package"
    minSdkVersion 15
    targetSdkVersion 25
    multiDexEnabled true
    versionCode 21
    versionName "2.1.3"

}

dexOptions {
    javaMaxHeapSize "4g"
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
//compile project(':rangebar')
compile('com.github.afollestad.material-dialogs:core:0.8.5.3@aar') { transitive = true }
compile('com.weiwangcn.betterspinner:library-material:1.1.0') {
    exclude group: 'com.android.support', module: 'appcompat-v7'
}
compile files('libs/itextpdf-5.5.9.jar')
compile 'com.android.support:multidex:1.0.1'
...

Application class extends Multidex :

public class MyApplication extends MultiDexApplication {
@Override
protected void attachBaseContext(Context base) {
    super.attachBaseContext(base);
    MultiDex.install(this);
}
}

I don't know what I am exactly missing to get rid of this matter

Thanks in advance.


Solution

  • I/MultiDex: install I/MultiDex: VM has multidex support, MultiDex support library is disabled.

    You should set

    public class MyApplication extends Application {
    

    Manifest

    <application
        android:name=".MyApplication"
       ....>
    

    Then Clean-Rebuild-Run .