Copy link to clipboard
Copied
Hello,
We've recently upgraded an application to AIR 16 and are having trouble getting under the 80mb size limit for iOS apps now. I've searched on the forums for this issue, but am unclear on specifics on how to proceed.
The exact error message is:
"Invalid Executable Size. The size of your app's executable file [filename] is 124010496 bytes, which exceeds the maximum allowed size of 80MB."
We are using ant do do the build on a Windows machine. The build xml is fairly large, but here are some relevant sections:
<target name="ios-test"> <antcall target="compile-ios-application"> <param name="argProject" value="[project]" /> <param name="argApplicationName" value="[application]" /> <param name="argRelease" value="test" /> <param name="argKeystore" value="certificates/id.p12" /> <param name="argStorePass" value="[password]" /> <param name="argIncludeFiles" value="[various icon files]" /> <param name="argBuildType" value="ipa-ad-hoc" /> <param name="argProvisioningFile" value="certificates/adhoc.mobileprovision" /> </antcall> </target>
<target name="compile-ios-application" depends="build-libraries"> <copy file="${COMMONS_DIR}/locale/${LOCALE}/text.properties" overwrite="true" tofile="${STAGING_DIR}/text.properties" /> <copy file="${COMMONS_DIR}/locale/${LOCALE}/celebrations.properties" overwrite="true" tofile="${STAGING_DIR}/celebrations.properties" /> <copy file="${COMMONS_DIR}/locale/${LOCALE}/error.properties" overwrite="true" tofile="${STAGING_DIR}/error.properties" /> <copy file="${basedir}/../${argProject}/config/ios.${argRelease}.config.properties" overwrite="true" tofile="${STAGING_DIR}/config.properties" /> <mxmlc file="${basedir}/../${argProject}/src/${argApplicationName}.mxml" output="${STAGING_DIR}/${argApplicationName}.swf" locale="${LOCALE}" services="${COMMONS_DIR}/services/${argRelease}.services-config.xml" static-rsls="false" accessible="false" configname="airmobile" debug="false" failonerror="true" fork="true" maxmemory="1024m" use-gpu="true"> <source-path path-element="${basedir}/../${argProject}/src" /> <source-path path-element="${FLEX_HOME}/frameworks" /> <source-path path-element="${STAGING_DIR}" /> <compiler.library-path dir="${FLEX_HOME}/frameworks" append="true"> <include name="libs" /> </compiler.library-path> <compiler.library-path dir="${basedir}/../libs/" append="true"> <include name="external" /> </compiler.library-path> <compiler.library-path dir="${basedir}" append="true"> <include name="staging" /> </compiler.library-path> <external-library-path file="${FLEX_HOME}/frameworks/libs/air/airglobal.swc" append="true" /> </mxmlc> <copy file="${basedir}/../${argProject}/src/${argApplicationName}-app.build" overwrite="true" tofile="${STAGING_DIR}/${argApplicationName}-app.xml" /> <mkdir dir="package" /> <for list="${argIncludeFiles}" param="includeFile"> <sequential> <copy file="${basedir}/../${argProject}/src/@{includeFile}" tofile="package/@{includeFile}" /> </sequential> </for> <java jar="${ADT}" fork="true" failonerror="true"> <jvmarg value="-Xmx2048m" /> <jvmarg value="-Xms1024m" /> <arg value="-package" /> <arg value="-target" /> <arg value="${argBuildType}" /> <arg value="-useLegacyAOT" /> <arg value="yes" /> <arg value="-provisioning-profile" /> <arg value="${argProvisioningFile}" /> <arg value="-storetype" /> <arg value="pkcs12" /> <arg value="-keystore" /> <arg value="${argKeystore}" /> <arg value="-storepass" /> <arg value="${argStorePass}" /> <arg value="${DEPLOY_DIR}/${argApplicationName}-${argBuildType}.ipa" /> <arg value="${STAGING_DIR}/${argApplicationName}-app.xml" /> <arg value="${STAGING_DIR}/${argApplicationName}.swf" /> <arg value="-C" /> <arg value="package" /> <arg value="." /> <arg value="-C" /> <arg value="${STAGING_DIR}" /> <arg value="${argApplicationName}.swf" /> </java> <antcall target="cleanup" /> </target>
In addition, there are about half a dozen SWCs in the project; they have bits that look like so:
<target name="compile-library"> <compc output="${argOutputDir}/${argProject}.swc"> <include-sources dir="${basedir}/../${argProject}/src" includes="**/*.as **/*.mxml" /> <source-path path-element="${basedir}/../${argProject}/src" /> <compiler.library-path dir="${FLEX_HOME}/frameworks" append="true"> <include name="libs" /> </compiler.library-path> <compiler.library-path dir="${basedir}/../libs/" append="true"> <include name="external" /> </compiler.library-path> <compiler.library-path dir="${basedir}" append="true"> <include name="staging" /> </compiler.library-path> </compc> </target>
I tried changing the compiler.library-path statements above to compiler.external-library-path, and while that significantly reduced the size of the temporary SWC files generated, the overall size of the build was unaffected. I have also tried setting uselegacyaot to 'no', explicitly setting debug to false, and optimize to 'true'.
I have a vague feeling, looking at the linker reports, that I might be including AIR multiple times because of all those SWCs, but I'm not sure if that's true or what I might do about that.
I'm afraid my knowledge of ant (and command-line compiling in general) is rather limited, so I'm not sure what else to try... any help anybody could give would be wonderful.
Thanks for your time.