How to enable multidexing with the new Android Multidex support library

后端 未结 14 2601
逝去的感伤
逝去的感伤 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:45

    SIMPLY, in order to enable multidex, you need to ...

    android {
    compileSdkVersion 21
    buildToolsVersion "21.1.0"
    
    defaultConfig {
        ...
        minSdkVersion 14
        targetSdkVersion 21
        ...
    
        // Enabling multidex support.
        multiDexEnabled true
    }
    ...
    }
    
    dependencies {
    implementation 'com.android.support:multidex:1.0.0'
    }
    

    also you must change your manifest file. In your manifest add the MultiDexApplication class from the multidex support library to the application element like this

    
    
       
           ...
       
    
    

提交回复
热议问题