修改项目的build.gradle文件,使用multidex并添加multidex库作为依赖,如下所示:
- android {
- defaultConfig {
- ...
- minSdkVersion 21
- targetSdkVersion 28
- multiDexEnabled true
- }
- ...
- }
-
- dependencies {
- compile 'com.android.support:multidex:1.0.1'
- }