AIR 3.4 ADT Bug - Unable to use [Embed] Tags
I'm attempting to use ANT to compile and package up an iOS IPA file using the Adobe SDK tools. I need to use ANT, because the build requires a tonne of RAM, and Flash Builder gets Java heap space issues when I compile (even though I've increased the max ram in the ini file).
This is what the core of my ANT build looks like:
<!-- Build the SWF and save it in the publish directory -->
<target name="3. Compile SWF" depends="2. Build New Directories">
<mxmlc
file="${MAIN_CLASS}"
output="${OUTPUT_SWF}"
debug="${DEBUG_FLAG}"
failonerror="true">
<load-config filename="${MOBI_CONFIG_FILE}"/>
<define name="MOBI_PROJECT::IS_iOS_BUILD" value="${IS_iOS_BUILD}" />
<define name="MOBI_PROJECT::DEBUG" value="${DEBUG_FLAG}" />
<source-path path-element="${MOBI_DIR}/src"/>
<library-path file="${FLEX_HOME}/frameworks/locale/en_US" append="true"/>
<library-path dir="${MOBI_LIB_RELEASE_DIR}" includes="*.swc" append="true"/>
<compiler.library-path dir="${FLEX_HOME}/frameworks" append="true">
<include name="libs/*" />
</compiler.library-path>
<compiler.external-library-path dir="${FLEX_HOME}/frameworks/libs/air">
<include name="**/*.swc" />
</compiler.external-library-path>
<compiler.external-library-path dir="${FLEX_HOME}/frameworks/libs">
<include name="**/*.swc" />
</compiler.external-library-path>
<compiler.external-library-path dir="${FLEX_HOME}/frameworks/libs/mx">
<include name="**/*.swc" />
</compiler.external-library-path>
</mxmlc>
</target>
<!-- Package the application to an ipa file & save it in the publish directory -->
<target name="4. Package Application" depends="3. Compile SWF">
<java jar="${ADT}" fork="true" failonerror="true">
<arg value="-package"/>
<arg value="-target"/>
<arg value="ipa-test"/>
<arg value="-provisioning-profile"/>
<arg value="${iOS_PROVISIONING}"/>
<arg value="-storetype"/>
<arg value="pkcs12"/>
<arg value="-keystore"/>
<arg value="${iOS_KEYSTORE}"/>
<arg value="-storepass"/>
<arg value="${iOS_PASS}"/>
<arg value="${IPA_FILE}"/>
<arg value="${APP_DESCRIPTOR}"/>
<arg value="${OUTPUT_SWF}"/>
</java>
</target>
I'm using Flex 4.6 SDK with Air 3.4 beta SDK and using airmobile-config.xml from the SDK as my config file.
But when I run this I get the following error:
4. Package Application:
[java] Exception in thread "main" java.lang.Error: Unable to find named traits: mx.core::SoundAsset
[java] at adobe.abc.Domain.resolveTypeName(Domain.java:232)
[java] at adobe.abc.Domain.resolveTypeName(Domain.java:149)
[java] at adobe.abc.GlobalOptimizer$InputAbc.resolveTypeName(GlobalOptimizer.java:272)
[java] at adobe.abc.GlobalOptimizer$InputAbc.readInstance(GlobalOptimizer.java:1000)
[java] at adobe.abc.GlobalOptimizer$InputAbc.readAbc(GlobalOptimizer.java:390)
[java] at adobe.abc.GlobalOptimizer$InputAbc.readAbc(GlobalOptimizer.java:278)
[java] at adobe.abc.LLVMEmitter.generateBitcode(LLVMEmitter.java:320)
[java] at com.adobe.air.ipa.AOTCompiler.convertAbcToLlvmBitcodeImpl(AOTCompiler.java:516)
[java] at com.adobe.air.ipa.BitcodeGenerator.main(BitcodeGenerator.java:80)
[java] Compilation failed while executing : ADT
If I remove all my [Embed] tags of audio, then the error is still there, but it complains about 'mx.core::ByteArrayAsset'. If I remove every single [Embed] tag in the project, then it compiles ok.
I've tried to force the SoundAsset class to be embedded by putting this line in my code:
import mx.core.SoundAsset;
...
new SoundAsset();
I've even gone into the Flex SDK and copied out the SoundAsset and ByteArrayAsset classes and put them in my project, but none of these things help.
I've tried linking my ANT Build to the Flex swcs like this:
<compiler.library-path dir="${FLEX_HOME}/frameworks/libs/mx" append="true"><include name="mx.swc"/></compiler.library-path>
<compiler.library-path dir="${FLEX_HOME}/frameworks/libs" append="true"> <include name="core.swc"/> </compiler.library-path>
But that doesn't work either.
Can anyone please tell me how to compile an IPA file via ANT while still keeping my [Embed] tags?
