Buy any Easy Native Extensions 2nd Edition package and get our $99 iOS + Android ANE Template completely free before the end of June 2015.
- step-by-step guide to making your iOS extension in under an hour
- library for data conversion between ActionScript and native code
- tutorials
- infographics
- code included
At the end of last year Apple announced their new requirements for submitting apps to the app store:
- from February 1st 2015 all new apps must include 64-bit support;
- from June 1st 2015 all app updates will also have to support 64 bits.
This doesn’t pose much of a problem for native apps, but we AIR developers were stranded… Until last week, when Adobe released AIR 16 beta in Adobe Labs. Let us go through the steps necessary for rebuilding your apps and ANEs to support 64 bits.
Step 1: Update your AIR SDK
1.1. Download AIR SDK 16 beta from Adobe Labs: http://labs.adobe.com/downloads/air.html
1.2. Make a backup copy of your AIR SDK folder.
1.3. Overlay the new SDK over the old one:
1.3.1 If you are a Windows user, unzip the download and copy the contents over your AIR SDK.
1.3.2. On Mac you can do the same and ask Finder to merge folders or, you can copy the archive in the root of your AIR SDK and run the following command in the Terminal:
1 |
sudo tar jxvf air16_sdk_sa_mac.tbz2 |
Step 2: Update your app descriptor
If you are a veteran AIR developer, you are used to this, but here it is just in case. Open your app descriptor file – usually named your-app-name-app.xml and found in your project’s src/ folder and make sure the namespace at the top of the file points to 16.0:
1 |
<application xmlns="http://ns.adobe.com/air/application/16.0"> |
Step 3: Rebuild your iOS ANEs
Any native extensions for iOS that your app uses will also need to be built with 64-bit support. If you have the source code for these ANEs, this is what you do:
3.1. Make sure you are using Xcode 6 and iOS SDK 8.
3.2. In your Xcode project, go to Build Settings > Architectures and first make sure that Architectures is set to Standard architectures (armv7, arm64), then set Build Active Architecture Only to No. Without the last change the compiler will default to building a binary that supports only one architecture, which matches the device that you have connected at the moment or the simulator version you have made active – good idea for a debug build, but not for release.
Now make a clean build of your ANE.
Step 4: How do you know if your app is now universal/64-bit?
… before submitting it to the Apple App Store, that is. There are a couple of things you can check.
First, if you build your app with AIR 16, you should NOT get an error message like this:
Or like this:
Then, to double-check, do the following:
4.1. Rename your .ipa file to .zip and unzip it.
4.2. Use lipo in the Mac Terminal:
1 |
lipo path_to_your_unzipped_ipa/Payload/your_app_name.app/your_app_name -info |
You want to see a message like this:
1 |
Architectures in the fat file: your_app_name are: armv7 arm64 |
4.3. You can also use the file command on Mac:
1 |
file path_to_your_unzipped_ipa/Payload/your_app_name.app/your_app_name |
This should result in a message like this one:
1 2 3 |
Mach-O universal binary with 2 architectures your_app_name (for architecture armv7): Mach-O executable arm your_app_name (for architecture arm64): Mach-O 64-bit executable |
Ta-da! Your app is now up to date with the 64-bit requirements.
katopz
This is really great guide! Love it! BTW lipo seem to missing ” -info”? e.g.
$ lipo Main/Payload/Main.app/Main -info
Not sure but my Mac seem to need it somehow
Cheers!
Radoslava
You are absolutely right, Katopz!
-info was missing, fixed now.
Thank you for letting us know!
Radoslava
Maurice
Hi, great Tutorial… works fine… but if i debug the app …. and touching the magic button … the app crashed with 1014 … class can not be found.
in project -> properties -> flex build packaging -> ios -> native Extensions the Package box is checkmarked
can’t find the problem
Radoslava
Hi Maurice,
Could you give us some details on what goes wrong:
– did the ANE work fine before the update?
– what changed during the update?
– what’s the exact error message that it shows when it crashes?
Thanks,
Radoslava
Maurice
– did the ANE work fine before the update?
Yes,
– what changed during the update?
In Xcode:
-> architectures: Standard (armv7,arm64)
-> valid architectures: armv7, armv7s, arm64
-> clean
-> build > *.a
Flash Builder:
as3 libproject with antscript and flex SDK 16.0
Run The Build Script -> Successfully
VerifyError: Error #1014: Class pl.randori.air.nativeextensions.ios::MailExtension could not be found.
Radoslava
Hi Maurice,
One thing to check would be if the ANE didn’t get packaged in the app’s IPA file for some reason.
You can rename .ipa to .zip, unzip it and have a look inside: there should be a META-INF folder and an ANE folder inside it, containing the native extension files.
Good luck,
Radoslava
Tushar Kachhadiya
Thanks in advance.
Help me about. I can’t release adobe air game in app store after 1st feb, because Appstore changed policy. so that I have download latest sdk. but it showing me below error. so please help me to create final .ipa which I can upload it in app store.
—————————
Adobe Flash Professional
—————————
Error creating files.
Error: META-INF/ANE/iPhone-ARM/AdMobAPI.a are required to have universal iOS libraries. Please contact the ANE developer(s) to get the same.
—————————
OK
—————————
Hristo
Hi Tushar,
The error suggests that you are using a 32-bit version of the AdMob ANE, rather than 64-bit or universal, as Apple now require.
A quick search seems to lead to an updated version in their repo: https://github.com/lilili87222/admob-for-flash/blob/master/admob_ane_ios_android/anes/admob_without_gps_20150209.ane
Try using this one instead.
Greetings,
Hristo
Tushar Kachhadiya
Hi
Thanks for reply.
Can you provide 64 bit ane files of.
“AdMob.ane, GameCenter.ane, NativeGATracker.ane,Social.ane ”
Because I got bellow errors while creating ipa.
—————————
Adobe Flash Professional
—————————
Error creating files.
Error: META-INF/ANE/iPhone-ARM/libSocialIosExtension.a, META-INF/ANE/iPhone-ARM/GameCenterAPI.a, META-INF/ANE/iPhone-ARM/libNativeGATracker.a, META-INF/ANE/iPhone-ARM/AdMobAPI.a are required to have universal iOS libraries. Please contact the ANE developer(s) to get the same.
—————————
OK
—————————
Hristo
Hi Tushar,
It’s best to contact the original developers of these ANEs.
Most of them seem to be provided by Nick Graham from http://www.sticksports.com.
Hopefully he can be of help.
Greetings,
Hristo
Tushar Kachhadiya
Hi,
I have implement admob and. which you have sent me.
it gave me following errors while creating ipa.
—————————
Adobe Flash Professional
—————————
Error creating files.
Included native extension ‘so.cuo.platform.admob’ includes a SWF version 25 which is greater than the version of the root SWF of this application: 15
—————————
OK
—————————
Thanks
Tushar
Radoslava
Hi Tushar,
As we aren’t the developers of either of the ANEs that you have mentioned (AdMob.ane, GameCenter.ane, NativeGATracker.ane, Social.ane), we are unable to provide support for them.
Have you been in touch with the original developers?
Greetings,
Radoslava
webbang
kevinui-MacBook-Pro:ane kevin$ “/Applications/Adobe Flash Builder 4.7/eclipse/plugins/com.adobe.flash.compiler_4.7.0.349722/AIRSDK/bin/adt” -package -target ane AirLibrary.ane AirLibrary-extension.xml -swc AirLibrary.swc -platform iPhone-ARM -C . . -platformoptions AirLibrary-ios-platformoptions.xml
Error: Apple App Store allows only universal applications. “libNativeExtensionTemplateiOS.a” is not a universal binary. Please change build settings in Xcode project to “Standard Architecture” to create universal library/framework.
컴파일 시 위와 같은 에러 발생한다.
AIRSDK 버전 : AIR24.0
Xcode : 버전 9.2
Architectures -> Standard architectures – $(ARHS_STANDARD)
Base SDK -> Latest(iOS 11.2)
Build Active Architecture Only -> No
Supported Platforms -> iOS
Valid Architectures -> arm64 armv7 armv7s
이유가 뭔가?
webbang
kevinui-MacBook-Pro:ane kevin$ “/Applications/Adobe Flash Builder 4.7/eclipse/plugins/com.adobe.flash.compiler_4.7.0.349722/AIRSDK/bin/adt” -package -target ane AirLibrary.ane AirLibrary-extension.xml -swc AirLibrary.swc -platform iPhone-ARM -C . . -platformoptions AirLibrary-ios-platformoptions.xml
Error: Apple App Store allows only universal applications. “libNativeExtensionTemplateiOS.a” is not a universal binary. Please change build settings in Xcode project to “Standard Architecture” to create universal library/framework.
The above error occurs when compiling.
AIRSDK version : AIR 24.0
Xcode:Version 9.2
Architectures – > Standard architectures – $ (ARHS _ STANDARD)
Base SDK – > Latest (iOS 11.2)
Build Active Architecture Only – > No
Supported Platforms – > iOS
Valid Architectures – > ar arm 64 ar mv7 s 7 s
Why?