IONIC Android Apk File size Way Too Big ! how to decrease the size of app for android?
You should use --prod
flag while building apk for production. It minimizes the size by compressing the files.
ionic build android --prod --release
For people running into that issue with newer versions of Ionic:
In Ionic 4.3 there seems to be a bug in the build scripts. If you run a debug build, and then a release/production build, the www
folder is not cleared and you will have all the sourcemap (.js.map) files in the www folder and thus in the final apk file.
See https://github.com/ionic-team/ionic-cli/issues/3954
Please use below command:
ionic cordova build android --minifycss --optimizejs --minifyjs --release
[note:- "ionic cordova build android --prod --release" command have email pattern matching issue in a form, always give invalid email error hence not used that command]
Use below link for more details:
https://ionicframework.com/docs/cli/cordova/build/