ADT (Eclipse) vs. Android Studio: How much APK file size difference is normal?

柔情痞子 提交于 2019-12-09 10:14:12

问题


I imported a ADT project to the latest version of Android Studio (0.6.1). Both projects share the same code and libraries. Also both projects were cleared and compiled with the same ProGuard settings enabled.

But the size of the ADT APK file is 1.8 MB and the Android Studio APK file is 2.7 MB.

Is this increase of 50% in APK file size considered as normal due to the fact that Android Studio is still in Early Access Preview or should I be able to get nearly the same APK file size?

(Update: I just unzipped the APK file: All files are nearly the same size, but the difference comes from the classes.dex file which is 1.2 MB on ADT and 4.4 MB on Android Studio.)


回答1:


By reverse engineering the classes.dex files I found out that my code wasn't obfuscated in Android Studio.

Even though it seemed to me that ProGuard was enabled via runProguard true in my build.gradle and the checkbox asking for ProGuard before generating the signed APK file.

I had to change the build variant of the app module from debug to release as described here.

Now both APK files are almost the same size (1.812 vs. 1.817 MB).



来源:https://stackoverflow.com/questions/24366944/adt-eclipse-vs-android-studio-how-much-apk-file-size-difference-is-normal

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