Skip to main content
Known Participant
September 18, 2018
Answered

iOS ANE with Swift framework embedded, XCode 9.4.1

  • September 18, 2018
  • 3 replies
  • 4117 views

We are trying to embed a Swift framework in our iOS/AIR app.

I'm following the tutorial by Sourabh Gupta

Swift based ANE for iOS/tvOS.


Since XCode 9 one can only build dynamic frameworks for 64 bit processors.

So our Swift framework "DummySwiftLib" is arm64 only.

When I'm building the ANE I get the following error.

"Error: Apple App Store allows only universal applications. "DummySwiftLib" is not a universal binary. Please change build settings in Xcode project to "Standard Architecture" to create universal library/framework."

Since we are unable to build universal dynamic frameworks, how to avoid this error?

ANE build command

adt -package -target ane YoWindowNative.ane extension.xml -swc uiNeLib.swc -platform iPhone-ARM -C ios/out . -platformoptions platformoptions.xml -platform default -C default .

We are building with AIR SDK 28.

Please help!

This topic has been closed for replies.
Correct answer el111

You can have a look at my basic setup here. <sdkVersion> is important also I believe.

Swift-IOS-ANE/platform.xml at master · tuarua/Swift-IOS-ANE · GitHub

Swift-IOS-ANE/build_ios.sh at master · tuarua/Swift-IOS-ANE · GitHub

I have written about 10 Swift based ANEs and did hit this problem once when I targeted only iOS11 (which I solved).

3 replies

Participant
September 25, 2020
Please help
I tried to create an ANE using IterableSDK, build the ANE when try to run the app it shows the crash report as
Termination Description: DYLD, Library not loaded: @rpath/IterableSDK.framework/IterableSDK | Referenced from: /var/containers/Bundle/Application/D6078430-31A2-447C-8A63-A36D8ED7888E/xxxxxxx.app/xxxxxxxxxx | Reason: image not found
 
Any kind of help is appreciated.
Legend
September 18, 2018

You need to set the minimum os version in your app xml InfoAdditions to the same as Xcode's Build Settings > iOS Deployment Target

eg

<InfoAdditions>

<![CDATA[

    <key>MinimumOSVersion</key>

    <string>11.0</string>

]]>

</InfoAdditions>

The  Deployment Target determines whether the .a is both 64bit and 32bit or just 64bit.

If you target iOS 11 then it produces only a 64bit lib as only 64bit devices can run iOS 11.

Also if you are using Xcode 9.4 you will need to use AIR30+ as you will run into signing issues with < 30.

par12812Author
Known Participant
September 19, 2018

Thank you so much, el111!

This error happens during ANE building with adt tool (not app (.ipa) building).

But I got the idea.

I've just tried to set ios_version_min to 11 in platformoptions.xml

<option>-ios_version_min 11.0</option>

Unfortunately, this didn't help.

The static library deployment target is set to 11 as well.

Still the mystery is unsolved.

el111Correct answer
Legend
September 19, 2018

You can have a look at my basic setup here. <sdkVersion> is important also I believe.

Swift-IOS-ANE/platform.xml at master · tuarua/Swift-IOS-ANE · GitHub

Swift-IOS-ANE/build_ios.sh at master · tuarua/Swift-IOS-ANE · GitHub

I have written about 10 Swift based ANEs and did hit this problem once when I targeted only iOS11 (which I solved).

Flipline
Inspiring
September 18, 2018

It looks like there have been some fixes in newer versions of the AIR SDK that relate to ANE packaging and Swift ANEs, have you tried AIR SDK 31 to see if you still get that error?

par12812Author
Known Participant
September 18, 2018

Thanks, Flipline! As soon as I've posted here I've tried to build with AIR SDK 31. Still the same error

adt -version

31.0.0.96