ADT(Eclipse中)与Android的工作室:多少APK文件大小的区别是正常的吗? [英] ADT (Eclipse) vs. Android Studio: How much APK file size difference is normal?

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

问题描述

我进口ADT项目到Android Studio的最新版本(0.6.1)。这两个项目共享相同的code和图书馆。另外两个项目都被清除,并启用相同的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.

这是增长了50%,在APK文件大小属于正常,由于这样的事实,Android的工作室仍处于早期试用preVIEW或者我应该能够得到几乎相同的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 文件,该文件是 1.2 MB 的ADT和 4.4 MB 在Android工作室)。

(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文件,我发现我的code的不混乱的Andr​​oid的工作室。

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

尽管在我看来,这ProGuard的是通过 runProguard启用真正在我build.gradle和复选框要求ProGuard的生成签名的APK文件之前。

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的工作室:多少APK文件大小的区别是正常的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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