方法数大于最大数,要分包处理,分三步走:
1,导入依赖
implementation 'com.android.support:multidex:1.0.3'
2,修改Application
MyApplication extends MultiDexApplication
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
3,添加config
defaultConfig {
applicationId "***"
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
multiDexEnabled true!!!!!