How to enable multidexing with the new Android Multidex support library

后端 未结 14 2392
逝去的感伤
逝去的感伤 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条回答
  •  -上瘾入骨i
    2020-11-21 13:54

    If you want to enable multi-dex in your project then just go to gradle.builder

    and add this in your dependencie

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

    then you have to add

     defaultConfig {
    ...
    minSdkVersion 14
    targetSdkVersion 21
    ...
    
    // Enabling multidex support.
    multiDexEnabled true}
    

    Then open a class and extand it to Application If your app uses extends the Application class, you can override the oncrete() method and call

       MultiDex.install(this) 
    

    to enable multidex.

    and finally add into your manifest

     
     
        
       ...
       
      
    

提交回复
热议问题