How to reduce size of the APK file generated by Apportable?

独自空忆成欢 提交于 2019-12-02 11:17:37

问题


I'm using Apportable to port my game and it works fairly well. But there's a problem here now. Apportable seems to link some library when generating the apk package and that makes the .apk file larger. The simplest Spin example's generated .apk file will be nearly 10Mb for this reason. However my game's .apk file has to be smaller than a size given by the publisher, and Apportable makes this size unable to achieve due to the extra 8Mb it added. Is there any way to reduce size of the generated .apk file? Maybe I can unlink some unused libraries but I don't know how to do that. Please help me or I will have to fallback to cocos2d-x and it will be much more troublesome to port the game :(


回答1:


An Apportable apk file will always be bigger than the corresponding iOS ipa file because unlike on iOS, the apk file needs to include libraries for functionality built into the iOS platform like Foundation, objc, and UIKIt.

Also, because of dynamic nature of Objective C, it is not possible to determine at build time what parts of the libraries could be excluded. In theory, it would be possible to do some library compression on an app specific basis, but it would be time-consuming and error prone and a 10M reduction would likely still be too much to reduce.

More discussion on the Apportable forum.



来源:https://stackoverflow.com/questions/18169999/how-to-reduce-size-of-the-apk-file-generated-by-apportable

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