APK size is bigger than expected - android studio

蓝咒 提交于 2019-12-21 07:08:04

问题


My project content size like this,

  1. Main Project (Source & asset size 513KB)
  2. Module 1 (Source & asset size 135KB)
  3. Module 2 (Source & asset size 80KB)

And the apk (signed, debug both) size is 4.87MB. Also tried ProGuard nothing changed.

I do not understand the reason of this. Even I have not added any jar file to my project.


回答1:


There are 2 build variants, for Debug and for Release. Default build option is for Debug which makes size big.

Check this answer : How to use the ProGuard in Android Studio?




回答2:


Clear the project and build again. Check raw, asset folder.

Give a look at this http://developer.android.com/tools/building/index.html .




回答3:


In case of a large png files existed try to enable the AAPT and use the next:

android {
    …
    buildTypes {
        release {
            crunchPngs true // or false
        }
    }
}


来源:https://stackoverflow.com/questions/22064591/apk-size-is-bigger-than-expected-android-studio

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