ADT(Eclipse)与Android Studio:APK文件大小差异是多少? [英] ADT (Eclipse) vs. Android Studio: How much APK file size difference is normal?

查看:277
本文介绍了ADT(Eclipse)与Android Studio:APK文件大小差异是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将ADT项目导入最新版本的Android Studio(0.6.1)。两个项目共享相同的代码和库。此外,两个项目都被清除并使用相同的ProGuard设置进行编译。

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.

但ADT APK文件的大小为1.8 MB,Android Studio APK文件为2.7 MB。

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

由于Android Studio仍处于早期访问预览,或者我可以几乎接近相同的APK文件大小?

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?

(更新:我刚刚解压APK文件:所有文件大小相同,但区别来自于 classes.dex 在ADT上为 1.2 MB ,Android Studio上为 4.4 MB

(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.)

推荐答案

通过反向编程classes.dex文件,我发现我的代码在Android Studio中没有被模糊化。

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

即使它似乎我通过我的build.gradle中的 runProguard true 启用ProGuard,并在生成签名的AP之前要求ProGuard的复选框K文件。

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.

现在,这两个APK文件几乎都是相同的大小(1.812对1.817 MB)。

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

这篇关于ADT(Eclipse)与Android Studio:APK文件大小差异是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆