for numbers in (), see links at the end
I am developping an Air Native Extension (ANE) in order to be able to use the burstly ads on mobile devices.
As for my setup, I am using the FlashDevelop 4.0.4 and Adobe Air 3.3. I'm using Flex 4.6.0 SDK. The project is setup on Windows7.
In order to work on iOS devices, Burstly requires a number of frameworks and librares
I managed to write and compile the .a library for iOS. I also have the interface (actionscript code) that will be shared for Android and iOS compiled into a swc and a librairy.swf. All of this is successfully packaged into a .ane which is included in my project.
When compiling a .a library on MacOS, all the framework and library used don't seems to be packaged in the ".a". This is why I had to use Air 3.3, for the -platformsdk option(1).
Since I work on Windows, I followed the instruction in this post to get the iOS SDK (2).
Following the required framework and (1), I made a platformConfig.xml file like this, which is packaged in the .ane
<platform xmlns="http://ns.adobe.com/air/extension/3.1">
<sdkVersion>4.2</sdkVersion>
<linkerOptions>
<!-- to use the AssetsLibrary framework -->
<option>-framework AssetsLibrary</option>
<option>-framework AudioToolbox</option>
<option>-framework AddressBook</option>
<option>-framework AVFoundation</option>
<option>-framework CFNetwork</option>
<option>-framework CoreLocation</option>
<option>-framework MapKit</option>
<option>-framework MediaPlayer</option>
<option>-framework MessageUI</option>
<option>-framework OpenAL</option>
<option>-framework OpenGLES</option>
<option>-framework QuartzCore</option>
<option>-framework StoreKit</option>
<option>-framework SystemConfiguration</option>
<option>-framework Foundation</option>
<option>-framework CoreGraphics</option>
<option>-libsqlite3</option>
<option>-libxml2</option>
<option>-libz</option>
</linkerOptions>
</platform>
and this is the line to compile the actuale .ane
call "%FLEX_SDK%\bin\adt" -package -target ane ../release/burstlyadsextension.ane extension.xml -swc burstlyAds.swc -platform iPhone-ARM library.swf libBurstlyAds.a -platformoptions platformConfig.xml
Problem arises when I try to package the iOS app with ADT:
call adt -package -target %TYPE%%TARGET% %OPTIONS% %SIGNING_OPTIONS% "%OUTPUT%" "%APP_XML%" %FILE_OR_DIR% -extdir lib/external/ -platformsdk ../Libraries/iPhoneOS5.0.sdk/
this happens:
"ld: library not found for -libsqlite3
Compilation failed while executing : ld64"
frameworks seems to be added fine, but the dylib are not. I tried to add the line:
<option>-L usr/lib/</option>
before including the lib, but I got this error instead:
"ld: warning: directory not found for option '-Lusr/lib/'
ld: library not found for -libsqlite3
Compilation failed while executing : ld64"
I tried to use the full path, other relative path, but no matter what path I put in the option, I always get a "warning: directory not found for option". Even "-L ../" give me this warning. The only thing that seems to work is "-L /../", but my .dylib obviousle are not there.
So my questions are: What did I do wrong? Any idead what else I could try? Even an explanation as to why it is not working would be helpful!
Links:
1: http://blogs.adobe.com/rajorshi/2011/11/16/ios5-support-for-airusing-external-sdks-to-package-apps/
2: http://blogs.adobe.com/airodynamics/2012/05/18/using-platformsdk-for-ios-on-windows/
Related
My project uses Admob to display ads. It works on Android but not on iOS. Build with Xcode is successful. When running the app in Xcode on simulator, I get the following runtime error:
Symbol not found: OBJC_CLASS$_GADInterstitialAd
Used the latest versions of:
external-dependency-manager-1.2.175.unitypackage
GoogleMobileAds-v7.4.0.unitypackage
Unity 2021.3.18f1
Xcode Version 12.4 (12D4e)
Contents of Assets/ExternalDependencyManager/Editor/1.2.175/AdMob_Dependencies.xml include iOS configuration:
<!-- iOS Cocoapod dependencies can be specified by each iosPod element. -->
<iosPods>
<iosPod name="Google-Mobile-Ads-SDK" version="~> 7.4" bitcodeEnabled="true"
minTargetSdk="14.0" addToAllTargets="false" />
<!-- Set of source URIs to search for this Cocoapod spec.
By default Cocoapods will attempt to fetch the pod specs from:
* $HOME/.cocoapods/repos
* https://github.com/CocoaPods/Specs
-->
<sources>
<source>https://github.com/CocoaPods/Specs</source>
</sources>
</iosPods>
I tried all versions of GoogleMobileAds from v7.0 to v7.4 unsuccessfully.
i have devloped an ANE that connects to a bluetooth printer in order to print ,this ane was working perfectly until IOS 11 has been publish
now what i see in the log is that the printer connects but cant print
i updated the xCode to support ios 11 and updates the air to 27 and compiled the new ane and the swc also compiled in air 27
now when i try to publish the app i got this msg "
Error occurred while packaging the application:
Error: META-INF/ANE/iPhone-ARM/libCoreMobileAPI.a,
META-INF/ANE/iPhone-ARM/libZebraChecker.a are required to have
universal iOS libraries. Please contact the ANE developer(s) to get
the same."
This ANE works only for IOS
iam sure that i have chosen universal iOS when i build the .a file
anyone has solution or can give me hints what to do
thanks
Descriptor XML
<?xml version="1.0" encoding="UTF-8"?>
<extension xmlns="http://ns.adobe.com/air/extension/27.0">
<id>BlCheck.ZebraAneBLCheck</id>
<versionNumber>1.0.0</versionNumber>
<platforms>
<platform name="iPhone-ARM">
<applicationDeployment>
<nativeLibrary>libZebraChecker.a</nativeLibrary>
<initializer>cubecomDoitflashZebraPrinterExtensionInitializer</initializer>
<finalizer>cubecomDoitflashZebraPrinterExtensionFinalizer</finalizer>
</applicationDeployment>
</platform>
<platform name="default">
<applicationDeployment/>
</platform>
</platforms>
</extension>
In Architectures settings of your target make sure you have your settings as below. Important parts are the "Valid Architectures" and the "Build Active Architecture Only" settings.
If that doesn't work make sure that you are using the correct .a file. You can run the following command on the .a file:
file libZebraChecker.a
It should output something like the following if it is a universal binary:
libZebraChecker.a: Mach-O universal binary with 2 architectures: [arm_v7: current ar archive] [arm64: current ar archive]
libZebraChecker.a (for architecture armv7): current ar archive
libZebraChecker.a (for architecture arm64): current ar archive
I've wrote a very simple plugin and added it to my config.xml:
<feature name="FileWriter">
<param name="ios-package" value="FileWriter" />
</feature>
after executing "Cordova prepare" it does not copy it to the staging/config.xml, and thus when I run the app I get an error:
2014-11-18 14:12:58.929 iOS Test[1280:723270] -[CDVCommandQueue executePending] [Line 158] FAILED pluginJSON = [
"FileWriter1220649673",
"FileWriter",
"cordovaGetFileContents",
[
]
]
If I manually add the feature to the config.xml found in the platform folder it works fine.
Basically there seems to be some sort of step missing in the "cordova prepare" step which is not copying this feature. All of the other elements in the base config.xml are copied properly to the platform specific one.
I've based the code off of the tutorial here
Follow the oficial tutorial instead
http://docs.phonegap.com/en/3.5.0/guide_hybrid_plugins_index.md.html#Plugin%20Development%20Guide
The one you linked is missing the part of the plugin.xml, that's the file read on cordova prepare to copy the necessary files to the iOS project.
Creating an Adobe AIR Native Extension that uses the following objC code will crash in iOS 5.1
NSDictionary *value=[NSDictionary dictionaryWithObjectsAndKeys: #"aSampleValue",#"aSampleKey",nil];
NSLog(#"Try objectForKeyedSubscript: %#", [value objectForKeyedSubscript:#"aSampleKey"]);
It will fail with "[__NSCFDictionary objectForKeyedSubscript:]: unrecognized selector"
I've got it working right now using Method Swizzling to remap NSDictionary objectForKeyedSubscript: to valueForKey: (if it doesn't exist) but I'm not super happy with that workaround. There's got to be a platform.xml option or compiler flag that will not strip these function calls in iOS 5.1 but I can't find anything. My
Note: This problem might look a lot like the following (and a few others, but I don't have the rep for the links) but it's not because a native xCode project works fine, but an ANE compiled with ADT does not.
Things tried and failed:
How to enable the new Objective-C object literals on iOS?
objectForKeyedSubscript: crash on iOS 5.1
SPECS
FlashBuilder/AIR:
SDK3.7
ADT -version: 3.7.0.1530
xCode project
BaseSDK: 6.1 (latest)
Valid Architectures: armv7 armv7s
Deployment Target: iOS 5.1
Platform.XML
(it's pretty long since it has some other support requirements)
<platform xmlns="http://ns.adobe.com/air/extension/3.7">
<linkerOptions>
<option>-ObjC</option>
<option>-weak_framework Accounts</option>
<option>-framework AddressBook</option>
<option>-framework AddressBookUI</option>
<option>-weak_framework AdSupport</option>
<option>-framework CoreLocation</option>
<option>-framework CoreMotion</option>
<option>-framework CoreTelephony</option>
<option>-framework EventKit</option>
<option>-framework EventKitUI</option>
<option>-framework iAd</option>
<option>-framework MapKit</option>
<option>-framework MediaPlayer</option>
<option>-framework MessageUI</option>
<option>-framework OpenAL</option>
<option>-weak_framework PassKit</option>
<option>-framework StoreKit</option>
<option>-weak_framework Twitter</option>
<option>-framework UIKit</option>
<option>-lsqlite3</option>
<option>-lxml2</option>
<option>-lz</option>
</linkerOptions>
</platform>
ADT Build Command:
adt -package -target ane build/MyANEName.ane ANE/extension.xml -swc ANE/MyANEName.swc -platform iPhone-ARM -platformoptions ANE/platform.xml -C ANE/ios .
I had this same issue, I solved it by using the -platformsdk option for ADT and pointing it to the iOS 6.1 SDK
On OSX this is located here:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk
So add this to your ADT command:
-platformsdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk
I'm trying to make my first ANE for iOS and I found a problem trying to compile the .IPA file.
The error I get is:
An implementation for native extension 'XXX' required by the application was not found for the target platform.
where, 'XXX' is the package for my ANE.
Well, I used Flash Build 4.6 with AIR 3.2 SDK to compile a SWC file with all functions I need.
I used XCode to compile a .A file with all Objective-C code needed.
Both files compiled fine.
Than I used ADT to compile the .ANE file. It also worked fine.
My extension.xml file seems ok:
<extension xmlns="http://ns.adobe.com/air/extension/3.1">
<id>XXX</id>
<versionNumber>1.0.0</versionNumber>
<name>ANE_NAME</name>
<platforms>
<platform name="iPhone-ARM">
<applicationDeployment>
<nativeLibrary>libExtension.a</nativeLibrary>
<initializer>ExtensionInitializer</initializer>
<finalizer>ExtensionFinalizer</finalizer>
</applicationDeployment>
</platform>
<platform name="default">
<applicationDeployment/>
</platform>
</platforms>
</extension>
Again, XXX is my extension's package. (like: com.example.myANE)
I'm also using a platform.xml file:
<?xml version="1.0" encoding="utf-8" ?>
<platform xmlns="http://ns.adobe.com/air/extension/3.1">
<sdkVersion>5.1</sdkVersion>
<linkerOptions>
<option>-ios_version_min 4.2</option>
</linkerOptions>
</platform>
And using the following code to compile the ANE:
adt -package -target ane MyANE.ANE extension.xml -swc MyANE.swc -platform iPhone-ARM -platformoptions platform.xml library.swf libExtension.a -platform default library.swf
It all works great and I have an ANE file.
Well, the project I'm working on already have 4 other ANE's so I don't think something is wrong with the flash part. But when I use ADT to compile an IPA, I get the error.
Anyone have an insight that could help?
You code to compile the ANE doesn't include the signing options.
My script to compile is similar than yours but it includes the following arguments:
-storetype pkcs12 -keystore mac.p12
Do not use a windows generated .p12 file if you are compiling on Mac. (The opposite is also true)
If it was that, you should be able to see errors on you iOS device's logs (something about not signed ANE that can't be loaded)
Also, remember to extract library.swf each time you compile your .swc project. Then you should clean your mobile project to include the new ANE.
Your ANE looks fine and if you're getting the ANE at the end I'd say you're doing that part correctly.
Most likely you're missing the -extdir option from when you're actually compiling your application.
adt -package
-target ipa-ad-hoc
-storetype pkcs12 -keystore YOUR_CERT.p12
-provisioning-profile YOUR_PROVISIONING_PROFILE.mobileprofile
myApp.ipa
myApp-app.xml
myApp.swf icons Default.png
-extdir extensionsDir
Or in FlashBuilder you've forgotten to package the extension with your application build, in settings under "Build Packaging". Take a look here for more information: http://distriqt.com/post/815