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.