Search code examples
iosframeworksairadobe

Missing architecture when adding framework to AIR Native Extension (ANE)


Currently I'm working on a Native Extension for AIR. I already got it working perfectly for android and I'm now taking on iOS. So far I've got it running and I have every method do some basic things, like showing an alert message. So I know the ANE is building and working fine by itself.

But now the problem I'm facing. I try to add some frameworks. One I build myself and is working in native apps and some third party ones. The ANE is still building fine, but when I add it to a testproject and run it, it says it's ignoring my file for missing the right architecture.

ld: warning: ignoring file /var/folders/zn/r6p91gln37n2323yj8rw1q6c0000gp/T/0bd78fa0-1b71-   4371-a6c5-a4ad3073df62/libcom.mycompany.myproduct.a, missing required architecture armv7 in file /var/folders/zn/r6p91gln37n2323yj8rw1q6c0000gp/T/0bd78fa0-1b71-4371-a6c5-a4ad3073df62/libom.mycompany.myproduct.a (2 slices)
ld: file too small for architecture armv7 
Compilation failed while executing : ld64

I have them added in my platform options:

<platform xmlns="http://ns.adobe.com/air/extension/3.8">
    <sdkVersion>6.0</sdkVersion>
    <linkerOptions>
        <option>-ios_version_min 6.0</option>
        <option>-framework coreTelephony</option>
        <option>-framework EventKit</option>
        <option>-framework MediaPlayer</option>
        <option>-framework MessageUI</option>
        <option>-framework SystemConfiguration</option>
        <option>-framework AdSupport</option>
    </linkerOptions>
    <packagedDependencies>
        <packagedDependency>ios/myproduct.framework</packagedDependency>
    </packagedDependencies>
</platform>

And I package it int the build command.

adt -package -target ane myproduct.ane extension.xml -swc myproduct.swc -platform Android-ARM -C android . -platform iPhone-ARM -platformoptions iosoptions.xml ios/myproduct.framework -C ios  . -platform default -C default .;

So can someone explain why it is correctly building the ane, but it cannot be run? And perhaps you can put me on the right track to solve this.

Thanks in advance.


Solution

  • I have figured it out. I was pointed in the wrong direction. It was the ANE itself that caused the problem. It was not properly build for armv7, the build target for the native library was set to the simulator. I changed it to iOS device and it worked. Of course I'm going to make it compile for both the simulator and real devices soon.

    If anyone stumbles upon this problem, feel free to send me a message and perhaps I can help.