Android的工作室:差异大小生成APK之间VS运行APK [英] Android Studio: Difference in size between Build APK vs Run APK

查看:842
本文介绍了Android的工作室:差异大小生成APK之间VS运行APK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到这些两个选项生成APK之间的尺寸差别。

I have noticed a difference in size between the apk generated with these 2 options.

为什么会出现这种情况?

why is this happening ?

通过在构建 - >构建APK 选项:

MyProject的\\程序\\编译\\输出\\ APK \\ APP-debug.apk(尺寸2.997 KB)

MyProject\app\build\outputs\apk\app-debug.apk (Size 2.997 KB)

通过在运行应用程序选项:

MyProject的\\程序\\编译\\输出\\ APK \\ APP-debug.apk(尺寸3.300 KB)

MyProject\app\build\outputs\apk\app-debug.apk (Size 3.300 KB)

感谢。

推荐答案

这很可能会更好,如果构成为问题到Android Studio团队回答。我的猜测是,你正在使用即时运行 Android的工作室(AS)内。因为即时运行产生了改变code代理类这就解释了更大的尺寸。

This would probably be better answered if posed as an issue to the Android Studio team. My guess is that you're using Instant Run inside Android Studio (AS). This would explain the larger size since Instant Run generates proxy classes for changed code.

编辑运行配置生成使用 gradle这个版本,你应该能够删除多余的$ C $ ç...但是,这将拿出一个更大的构建/部署时间。如果调试版本的大小是非常重要的给你,然后确定,但对于大多数这样会毁了Android团队已经到DSL最近作出的所有改进以提高速度。

Edit the Run configuration to build using gradle build and you should be able to remove the extra code... But this WILL come with a much larger build/deploy time... If size of a debug build is really important to you then OK but for most this will ruin all the improvements the Android team has made to the DSL recently to improve speed

这篇关于Android的工作室:差异大小生成APK之间VS运行APK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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