[SOLVED] building an ane which include third party framework and using it
I made a ane which using third party framework. Without packing the framework into ane, the ane works fine, and using the framework directly in xcode, it works perfectly too.
But when pack the framework into ane, I got the error when using it to build a ipa:
ld: warning: ignoring file /var/folders/c0/m8m1_z5915qblkj9d_7jhmcw0000gn/T/3cb383e9-0092-4b1c-9 09f-5c219b2fbcd4/Partytrack.framework/Partytrack, file was built for unsupported file format ( 0x56 0x65 0x72 0x73 0x69 0x6f 0x6e 0x73 0x2f 0x43 0x75 0x72 0x72 0x65 0x6e 0x74 ) which is not the architecture being linked (armv7): /var/folders/c0/m8m1_z5915qblkj9d_7jhmcw0000gn/T/3cb383e9-0092-4b1c-9 09f-5c219b2fbcd4/Partytrack.framework/Partytrack
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Users/apple/Documents/flexsdk/flex3.9/lib/aot/lib/libDebugger1.arm-a ir.a(avmplusDebugger.cpp.o)
Undefined symbols for architecture armv7:"_OBJC_CLASS_$_Partytrack", referenced from:objc-class-ref in libcom.haibin.extension.PromotionAPI.a(partyTrackAPI.o)
ld: symbol(s) not found for architecture armv7
Compilation failed while executing : ld64
The message "is not the architecture being linked (armv7)" is wrong because i using lipo command and get the framework info:
lipo -info Partytrack.framework/Partytrack
Architectures in the fat file: Partytrack.framework/Partytrack are: armv7 armv7s i386
So is it can't find the framework file?
--------
I'm using Air 3.9
This is how i build the ane:
My platformoptions.xml file content:
<platform xmlns="http://ns.adobe.com/air/extension/3.8">
<sdkVersion>7.0</sdkVersion>
<linkerOptions>
<option>-ios_version_min 4.3</option>
<option>-framework CoreData</option>
<option>-framework UIKit</option>
<option>-framework Foundation</option>
<option>-framework Security</option>
<option>-weak_framework AdSupport</option>
</linkerOptions>
<packagedDependencies>
<packagedDependency>Partytrack.framework</packagedDependency>
</packagedDependencies>
</platform>
And my build command are:
| <target name="package" description="Create the extension package"> | |
| <exec executable="${FLEX_HOME}/bin/adt" failonerror="true" dir="../"> | |
| <env key="AIR_SDK_HOME" value="${FLEX_HOME}"/> | |
| <arg value="-package"/> | |
| <arg line="-storetype pkcs12"/> | |
| <arg line="-keystore build/testkey.p12"/> | |
| <arg line="-storepass 123456"/> | |
| <arg line="-target ane"/> | |
| <arg value="${ANE_NAME}.ane"/> | |
| <arg value="build/extension.xml"/> | |
| <arg line="-swc swc/${ANE_NAME}.swc"/> | |
| <arg line="-platform iPhone-ARM -platformoptions build/platform.xml -C ios/ . "/> | |
| <arg line="-platform Android-ARM -C android/ ."/> | |
| <arg line="-platform default -C default/ ."/> | |
| </exec> | |
| </target> |
File "Partytrack.framework " is in the directory "ios"
I unzip the ane file and see the file Partytrack.framework is successfully packed into it.
&: I use flash builder to build a ipa.
