为什么由钛合金生成的APK如此之大?

时间:2015-01-19 18:54:19

标签: android titanium-alloy

即使是"你好世界" APK大小是10MB。这是标准吗?有没有办法减小尺寸?

2 个答案:

答案 0 :(得分:0)

每次构建都包含钛运行时。此运行时负责跨平台运行应用程序。

减少结果APK大小的一种方法是通过不需要的模块。

模块在两个地方被引用。

首先是您项目的tiapp.xml文件。检查该部分中是否有任何未使用的模块。

第二名是Titanium SDK安装。在OSX上,modules.json位于~/Library/Application Support/Titanium/mobilesdk/osx/3.4.1.GA/android内。 modules.json中的模块引用自动包含在应用程序中。您可以删除未使用的模块,但要小心。您很可能会丢失某些功能,或者它可能会导致钛运行时崩溃。

答案 1 :(得分:0)

use the following code in tiapp.xml file.

 <android xmlns:android="http://schemas.android.com/apk/res/android">
        <manifest></manifest>
        <abi>armeabi</abi>
 </android>

Earlier we were using these 2 libraries.
A) armeabi 
B) armeabi-v7a

Each libraries using 5.2 Mb size on run time making the total build size 10.4 Mb.
So now we are using one armeabi libraries to restrict other armeabi-v7a libraries in the code which reduce the apk size to 5.2 Mb.
相关问题