IONIC Android Apk File size Way Too Big ! how to decrease the size of app for android?

早过忘川 提交于 2019-12-05 14:15:25

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 if you run a debug build, and then a release/prod 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/

Run cordova clean to cleanup project from build artifacts.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!