How to reduce apk size, libs and the default ionic folder


#1

Im having troubles understanding the way my default lib works and what goes into the apk. While trying to reduce my app’s size which is around 35MB (including crosswalk splited to x86 and arm), i found out i have two main large folders in my project:

  1. ionic
  2. ng-cordova-master

for #2 i deleted all the files which werent in “dist” folder and it seems to be working just fine. The original folder was about 10MB and it saved about 3MB to my apk.

for #1 i tried to do the same. i found out that my includes werent to the “.min” files of ionic and changed that. it didnt effect the size. then i deleted the ionic.bundle.js and hoped i can use only the 5 times thinner verion: ionic.bundle.min.js but my app crushed to a white screen.
i didnt give up and deleted two folders: demos and release. they weight about 5MB together which saved about 2.7MB to my final apk. it all seems to be working just fine.

What am i missing here? it feels like i fundamentally doing something wrong if deleting parts of ionic’s lib reduce my apk yet still work just fine.

Here is how i build my apk:
ionic build --release android
i use a nice popup that asks for my pass:
the file release-signing.properties containsmy pass and key storage file.
and i got the cdvBuildMultipleApks=true for crosswalk.

my imgs weight about 1.7MB altogether, my splash screen is very small but my libs folder is 30MB.
What am i doing wrong here? it doesnt make sense i need to delete parts of some folders in libs…

Thanks,
Jonathan