How to enable multidexing with the new Android Multidex support library

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

    First you should try with Proguard (This clean all code unused)

    android {
        compileSdkVersion 25
        buildToolsVersion "25.0.2"
    
        defaultConfig {
            minSdkVersion 16
            targetSdkVersion 25
            versionCode 1
            versionName "1.0"
    
            testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
            multiDexEnabled true
        }
        buildTypes {
            release {
                minifyEnabled true
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }
    

提交回复
热议问题