Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The Apk file exported from Android Studio is too large

I have never used Android Studio before. The size of a simple "Hello world" app generated by default is almost 800k, while it is less than 100k in eclipse. I find that there are too many pictures in the drawable files, they seem come from res/all under the build folder, they still exist even if I delete the folder res manually.

My question is how to shrink the apk size in this situation?

like image 572
withparadox2 Avatar asked Dec 11 '13 10:12

withparadox2


1 Answers

The difference is due to the appcompat library which is compiled in by default to New Project Wizard-generated projects in Android Studio if you target an API level lower than 14. When I ran a test, the size increase was 642k for a debug APK, and 411k for a release APK (with Proguard enabled -- that will strip out unused code but not unused resources).

There's not a lot you can really do about this, short of removing the appcompat library if you're not using any of its features (though you should probably be using its features).

like image 148
Scott Barta Avatar answered Sep 21 '22 01:09

Scott Barta