Highlighted

iOS ANE with Swift framework embedded, XCode 9.4.1

Community Beginner ,
Sep 18, 2018

Copy link to clipboard

Copied

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!

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).

TOPICS
Development

Views

2.0K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

iOS ANE with Swift framework embedded, XCode 9.4.1

Community Beginner ,
Sep 18, 2018

Copy link to clipboard

Copied

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!

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).

TOPICS
Development

Views

2.0K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 18, 2018 0
Engaged ,
Sep 18, 2018

Copy link to clipboard

Copied

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?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 18, 2018 0
Community Beginner ,
Sep 18, 2018

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 18, 2018 0
Engaged ,
Sep 18, 2018

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 18, 2018 0
Community Beginner ,
Sep 18, 2018

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 18, 2018 0
Engaged ,
Sep 19, 2018

Copy link to clipboard

Copied

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).

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 19, 2018 1
Community Beginner ,
Sep 21, 2018

Copy link to clipboard

Copied

It turned out the problem was somewhere in our Swift framework.

The ANE built just fine, as soon as I replaced our framework to the one from your example (HelloWorldANE_FW.framework).

I've found lots of useful details from your tutorial.

Thank you so much for the hard work.

I was finally able to run Swift code in our app.

To my surprise .ipa file grew up from 27 to 57 MB after Swift integration.

Too much.

It hurts, but we have to abandon the idea of Swift coding for AIR.

Again, el111, thank you for responding to my call, you are awesome!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 21, 2018 0
Engaged ,
Sep 23, 2018

Copy link to clipboard

Copied

I understand being surprised however don't confuse IPA size with the size of the final app in the App Store.

The size increase are the official Apple Swift libraries. If you build an iOS app with Swift in Xcode it produces an ipa with the same Swift files (which is most new apps now)

It's important to know that this doesn't mean a user who downloads the app from the app store downloads a file the same size as your ipa.

After you upload the ipa Apple compress/strip/thin the app

Apple say this "The size of libswiftCore.dylib in your IPA, and the size of your IPA in general, is somewhat meaningless these days. The new thinning features in the store will remove unnecessary content from your app when delivering to specific devices, and libswiftCore.dylib contains bitcode even if your app doesn't. This bitcode is removed before your app is downloaded to a customer device."

ios - What is the file size overhead of the bundled Swift libraries compared to an Objective-C app? ...

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 23, 2018 0
Community Beginner ,
Sep 23, 2018

Copy link to clipboard

Copied

Wow! I'm going to make an experiment. Will try to upload a new build with Swift on board. Let's see how much megabytes to add app.

Thank you!!!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 23, 2018 0
Community Beginner ,
Sep 24, 2018

Copy link to clipboard

Copied

I've just built our app for App Store with Swift framework on board.

But I stumbled upon this error while uploading to App Store

"ERROR ITMS-90075: "This bundle is invalid. The application-identifier entitlement is missing; it should contain your 10-character Apple Developer ID, followed by a dot, followed by your bundle identifier.""

Found this topic.

ERROR ITMS-90075 submitting to iTunes with FB & Air 28 using dynamic frameworks

The solution provided looks too complicated for us.

Is there another way to resolve this signing error?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 24, 2018 0
Engaged ,
Sep 24, 2018

Copy link to clipboard

Copied

I am able to build a valid App Store .ipa.

I always use /Applications/Xcode.app/Contents/Applications/Application\ Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Support/altool --validate-app -f /path/to/App.ipa -u [UN] -p [PW] to verify

Which version of AIR and Xcode are you using?

Are you using/packaging any other 3rd party frameworks?

What entitlements have you included in app-xml ?

If you have included "aps-environment" is it set to "production"

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 24, 2018 0
Community Beginner ,
Sep 25, 2018

Copy link to clipboard

Copied

Thank you, el!


Using altool is handy, I didn't know about this trick, thank you!

I'm building with XCode 9.4.1

Adobe AIR SDK for Mac 31

No third party frameworks.

Though, we are using third party ANEs.

There was no aps-environment in our manifest, so I've added it.

New errors showed up.

Do you know how to fix them?

"Error Domain=ITunesConnectionOperationErrorDomain Code=1091 \"Invalid Code Signing Entitlements. The entitlements in your app bundle signature do not match the ones that are contained in the provisioning profile. The bundle contains a key that is not included in the provisioning profile: 'aps-environment' in 'Payload/YoWindow 0.app/YoWindow 0'.\"

"Error Domain=ITunesConnectionOperationErrorDomain Code=1091 \"Invalid Code Signing Entitlements. The entitlements in your app bundle signature do not match the ones that are contained in the provisioning profile. The bundle contains a key that is not included in the provisioning profile: 'aps-environment' in 'Payload/YoWindow 0.app/Frameworks/HelloWorldANE_FW.framework/HelloWorldANE_FW'.\"

"Error Domain=ITunesConnectionOperationErrorDomain Code=1091 \"Invalid Code Signing Entitlements. The entitlements in your app bundle signature do not match the ones that are contained in the provisioning profile. The bundle contains a key that is not included in the provisioning profile: 'aps-environment' in 'Payload/YoWindow 0.app/Frameworks/FreSwift.framework/FreSwift'

I'm packaging Swift frameworks from your project.

FreSwift.framework and HelloWorldANE_FW.framework

They are NOT signed at the moment of packaging.

This is the contents of Frameworks folder.

FreSwift.framework

HelloWorldANE_FW.framework

libswiftCore.dylib

libswiftCoreFoundation.dylib

libswiftCoreGraphics.dylib

libswiftCoreImage.dylib

libswiftDarwin.dylib

libswiftDispatch.dylib

libswiftFoundation.dylib

libswiftMetal.dylib

libswiftObjectiveC.dylib

libswiftos.dylib

libswiftQuartzCore.dylib

libswiftUIKit.dylib

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 25, 2018 0
Engaged ,
Sep 25, 2018

Copy link to clipboard

Copied

If there was no app-environment before then remove it. It's not that.

Given that the error is saying "The application-identifier entitlement is missing" then you could try adding it.

<Entitlements><![CDATA[

<key>application-identifier</key>

<string>XXXXXXXX.com.yourcompany.appid</string>

]]>

</Entitlements>

Update XXXXXXXX with your Apple team identifier

Update com.yourcompany.appid with your application Id

When building your Framework ensure "Provisioning Profile" Is set to none and Development Team is set to "" in Xcode

EDIT:

This can also be caused by using a wildcard app id in your distribution provisioning profile

com.mycompany.*

It  should be absolute

com.mycompany.myapp

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 25, 2018 0
Community Beginner ,
Sep 28, 2018

Copy link to clipboard

Copied

Hi, el!

Thank you for so much help.

I'm sorry for the delay.

I have made an attempt to simplify the framework code I borrowed from your project.

I removed FreSwift lib.

Just one Swift class that prints a text to console.

According to your advice I have set "Provisioning Profile" to none.

Application identifier has always been added to the manifest. It is ok.

The distribution provisioning profile is absolute and has no asterisk.

Everything (Swift framework, ANE and AIR project) builds fine.

But when I'm launching the app, I get the following crash.

This is where I'm stuck.

I have just upgraded to XCode 10 and Swift 4.2

Probably this is the cause of the crash.

I wonder if you can help.

Exception Type:  EXC_CRASH (SIGABRT)

Exception Codes: 0x0000000000000000, 0x0000000000000000

Exception Note:  EXC_CORPSE_NOTIFY

Termination Description: DYLD, Symbol not found: _$SBOWV | Referenced from: /private/var/containers/Bundle/Application/BF0ADD20-D432-4839-AE3E-AD25A9AA95DD/YoWindow Weather.app/Frameworks/HelloWorldANE_FW.framework/HelloWorldANE_FW | Expected in: /private/var/containers/Bundle/Application/BF0ADD20-D432-4839-AE3E-AD25A9AA95DD/YoWindow Weather.app/Frameworks/libswiftCore.dylib | in /private/var/containers/Bundle/Application/BF0ADD20-D432-4839-AE3E-AD25A9AA95DD/YoWindow Weather.app/Frameworks/HelloWorldANE_FW.framework/HelloWorldANE_FW

Triggered by Thread:  0

Filtered syslog:

None found

Thread 0 Crashed:

0   dyld                          0x00000001057262f8 __abort_with_payload + 8

1   dyld                          0x0000000105725ad0 abort_with_payload_wrapper_internal + 100

2   dyld                          0x0000000105725afc fcntl + 0

3   dyld                          0x00000001056fc314 dyld::fastBindLazySymbol+ 17172 (ImageLoader**, unsigned long) + 0

4   dyld                          0x00000001056ff4cc dyld::_main+ 29900 (macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) + 7152

5   dyld                          0x00000001056f921c _dyld_start + 68

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 28, 2018 0
Engaged ,
Nov 17, 2018

Copy link to clipboard

Copied

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 17, 2018 0
Community Beginner ,
Nov 17, 2018

Copy link to clipboard

Copied

Hi, el!

Unfortunately, we had to abandon the idea of using Swift and took Objective C route instead.

Probably we to take one more try to merry AIR and Swift in the future.

Then I'll be back reading these threads.


Thank you so much for the help, you are awesome!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 17, 2018 0
New Here ,
Sep 25, 2020

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 25, 2020 0