android {
defaultConfig {
// ...
multiDexEnabled true
}
// ...
}
dependencies {
implementation 'androidx.multidex:multidex:2.0.1'
}
public class MyApplication extends MultiDexApplication {
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
// ...
}
<application
android:name=".MyApplication"
// ...
>
// ...
</application>
<target name="-dex" depends="-compile, -post-compile" description="Convert class files to dex files">
<dex executable="${dx}" output="${intermediate.dex.file}" input="${out.classes.absolute.dir}"></dex>
</target>
android {
defaultConfig {
// ...
multiDexEnabled true
}
// ...
}