我的APK大小增加谷歌播放服务(AdMob的)后,从65千字节提高到8.8兆字节 [英] My APK size increased from 65 Kbytes to 8.8 MBytes after adding google play services (for admob)

查看:246
本文介绍了我的APK大小增加谷歌播放服务(AdMob的)后,从65千字节提高到8.8兆字节的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个小的应用程序安装apk文件时,只有富人65KB的大小。现在,我需要使用的AdMob上的应用程序,并添加谷歌播放服务lib目录后,现在已经安装在我的应用程序富人8.8兆字节大小的!!!!!!!这非常令人沮丧...

I have a small app that only haves a size of 65kb when apk is installed. Now i need to use admob on the app, and after adding google play services lib, now my app haves 8.8 megabytes of size when installed!!!!!!! this very frustrating...

这又如何避免?我想,以减少大小的APK

我使用ProGuard的这个配置,以避免谷歌播放服务的错误时,产生一个释放签署APK:

i am using proguard with this config to avoid google play services errors when generating a release signed apk:

-dontwarn com.google.android.gms。**

-dontwarn com.google.android.gms.**

感谢

推荐答案

使用Android的工作室,你可以采取的分拆谷歌播放服务库,确保你只包括谷歌播放必要的服务为你需要的部分。你的情况,你可以使用

Using Android Studio, you can take advantage of the split Google Play Services libraries, ensuring you only include the part of Google Play Services necessary for what you need. In your case, you could use

compile 'com.google.android.gms:play-services-ads:6.5.87'

而不是完整的玩-服务相关性应该大大减少你的APK大小。

Instead of the full play-services dependency which should reduce your APK size tremendously.

使用 ProGuard的资源萎缩允许你删除未使用的code和资源,从您的应用程序,甚至进一步降低了图书馆的使用只有最低限度的大小。

Using ProGuard and resource shrinking allows you to remove unused code and resources from your application, even further reducing the size of libraries you use to only the bare minimum.

这篇关于我的APK大小增加谷歌播放服务(AdMob的)后,从65千字节提高到8.8兆字节的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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