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

Praveen Vishnu picture Praveen Vishnu · Jun 22, 2018 · Viewed 7.7k times · Source

I have developed the app using ionic 3 and now while generating android apk file it 's size getting way too big.

before the API integration The File Size Was 4.8MB once I Started API Interation I just Modified 10 Pages Then The APK File Size became 71 MB

Cordova Plugins I have Used

cordova-plugin-console 
cordova-plugin-datepicker
cordova-plugin-device
cordova-plugin-network-information
cordova-plugin-splashscreen
cordova-plugin-statusbar
cordova-plugin-whitelist
cordova-plugin-x-socialsharing
cordova-sqlite-storage
es6-promise-plugin
ionic-plugin-keyboard

I unziped the APK file to know what's Happening i Looked Into into The build Folder in assets/www/ folder weighing 357MB and it contains js files and MAP files

the Rest Assests folder In WWW whis contains the Css File is Of 4.5 MB

how to decrease the size of app for android apk?

Answer

suzan picture suzan · Jun 22, 2018

You should use --prod flag while building apk for production. It minimizes the size by compressing the files.

ionic build android --prod --release