问题
Is there a way to set enable multidex (https://github.com/casidiablo/multidex) for Android if I build apps using Ionic Framework ?
回答1:
There is a plugin that enables multidex. To install it, run:
cordova plugin add --save https://github.com/jwall149/cordova-multidex
And try building again. The build may take a little longer than usual, but your app should compile without troubles.
回答2:
For people using androidx
and cordova-android: 8
is interested in this solution, I created a fork that supports the file structure and class names of these new versions. Also works with Ionic.
cordova plugin add --save https://github.com/c00/cordova-multidex
Note that this is only relevant if you are still supporting a minSdk
less than 21. At 21, multidexing is no longer needed as there is some built-in fix for it. So in that case, just remove the multidex plugin (if you had it) and things should work.
来源:https://stackoverflow.com/questions/34259679/enable-multidex-for-android-in-ionic-framework