implementation 'com.android.support:multidex:1.0.3'
defaultConfig {
applicationId "com.example.colormaterial"
minSdkVersion 19
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
// 解决bug :Cannot fit requested classes in a single dex file (# methods: 95704 > 65536 ; # fields: 68297 > 65536)
multiDexEnabled true
}
如果创建了application的话,需要进行初始化:
@Override
public void onCreate() {
super.onCreate();
instance=this;
sign = SignUtils.getSign(this);
SignUtils.check(sign);
MultiDex.install(this);
}