How to enable multidexing with the new Android Multidex support library

后端 未结 14 2397
逝去的感伤
逝去的感伤 2020-11-21 12:57

I want to use the new Multidex support library to break the method limit for one of my apps.

With Android Lollipop Google introduced a multidex support library that

14条回答
  •  独厮守ぢ
    2020-11-21 13:47

    Add to AndroidManifest.xml:

    android:name="android.support.multidex.MultiDexApplication" 
    

    OR

    MultiDex.install(this);
    

    in your custom Application's attachBaseContext method

    or your custom Application extend MultiDexApplication

    add multiDexEnabled = true in your build.gradle

    defaultConfig {
        multiDexEnabled true
    }
    
    dependencies {
        compile 'com.android.support:multidex:1.0.0'
        }
    }
    

提交回复
热议问题