IOS native extension for networkinfo throws an error
Hello,
I'm trying to check wether the active connection on a device is Wifi or mobile data connection. On android this works fine but on iOS there is a problem.
A native extension exists for this see here.
The problem is that the line below throws an error: 'Error #1009: Cannot access a property or method of a null object reference.'
var interfaces:Vector.<com.adobe.nativeExtensions.Networkinfo.NetworkInterface> = com.adobe.nativeExtensions.Networkinfo.NetworkInfo.networkInfo.findInterfaces();
I'm using AIR3.1 (no idea if this works on 3.0).
Anybody a solution?
Ever solve this? I'm also getting errors...
Specifically:
ArgumentError: Error #3500: The extension context does not have a method with the name getInterfaces.
Similar Messages
-
Creating ios native extension with 3rd party frameworks
Hello,
I'm new to Air development and creating a ios native extension for my flex mobile project.I want to include third party frameworks such as admob,facebook,chartboost in my ANE
I have tried to link frameworks using packagedDependencies but it dosn't work.(gives me an error telling that "armv7 not supported")
am I doing something wrong? or is there any proper way to link frameworks?
platformoptions.xml
<platform xmlns="http://ns.adobe.com/air/extension/4.0">
<sdkVersion>7.1</sdkVersion>
<linkerOptions>
<option>-ios_version_min 6.1</option>
<option>-framework StoreKit</option>
<option>-framework CoreGraphics</option>
<option>-framework UIKit</option>
<option>-framework Foundation</option>
</linkerOptions>
<packagedDependencies>
<packagedDependency>frameworks/Chartboost.framework</packagedDependency>
<packagedDependency>ios/libAdExtension.a</packagedDependency>
</packagedDependencies>
</platform>
extensionxml
<extension xmlns="http://ns.adobe.com/air/extension/4.0">
<id>com.my.extensions</id>
<versionNumber>1</versionNumber>
<platforms>
<platform name="iPhone-ARM">
<applicationDeployment>
<nativeLibrary>libAdExtension.a</nativeLibrary>
<initializer>ExtInitializer</initializer>
<finalizer>ExtFinalizer</finalizer>
</applicationDeployment>
</platform>
</platforms>
</extension>
-command
/Applications/Adobe\ Flash\ Builder\ 4.7/sdks/4.6.0+airSDK4.0/bin/adt -package -target ane adExtension.ane extension.xml -swc bin/AdsLibrary.swc -platform iPhone-ARM library.swf frameworks/Chartboost.framework ios/libAdExtension.a -C ios . -platformoptions platformoptions.xml
-error
ld: warning: ignoring file /var/folders/3r/x0bh_4.... file was built for unsupported file format ( 0Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_Chartboost", referenced from:
ld: symbol(s) not found for architecture armv7
Compilation failed while executing : ld64
*I used lipo to combine simulator and device .a files
please helpFrom the catalog Chartboost.framework copy the static library file Chartboost(path: Chartboost.framework/Versions/A/Chartboost) and use it instead of .framework :
<platform xmlns="http://ns.adobe.com/air/extension/4.0">
<sdkVersion>7.1</sdkVersion>
<linkerOptions>
<option>-ios_version_min 6.1</option>
<option>-framework StoreKit</option>
<option>-framework CoreGraphics</option>
<option>-framework UIKit</option>
<option>-framework Foundation</option>
</linkerOptions>
<packagedDependencies>
<packagedDependency>frameworks/Chartboost</packagedDependency>
<packagedDependency>ios/libAdExtension.a</packagedDependency>
</packagedDependencies>
</platform>
adt -package -target ane adExtension.ane extension.xml -swc bin/AdsLibrary.swc -platform iPhone-ARM library.swf frameworks/Chartboost ios/libAdExtension.a -C ios . -platformoptions platformoptions.xml -
Native Extension for AIR publishing error : framework not found
Hello,
I'm trying to build an iOS app using native extensions for AIR, but when I publish, I've an error message saying : framework not found
I tried with this ANE for GameCenter integration : https://github.com/StickSports/ANE-Game-Center
it says " ld: framework not found GameKit "
Same problem with GREE Platform SDK for AIR :
https://docs.developer.gree.net/en/globaltechnicalspecs/#sdkforair
it says " ld: framework not found CoreTelephony "
The thing is that these frameworks are already included, I guess.
I'm using flash cs6 on mac, and I've included the path to iOS SDK in the publishing settings.Are you using the ANE from there or are you recompiling the ANE at your end?
If you are recompiling, please make sure that you are using the platform.xml file they have provided.
If you are using their precompiled ANEs, probably, the path to iOS SDK is not correct. It should be upto the folder iPhoneOSx.y.sdk. -
Facing error#3500 while running AIR native extension for windows
Hi,
I am stuck in a problem regarding AIR native extension from couple of days.Whenever I tried to run an extension for windows it gives error code 3500 (extension context cannot have the method ie methodname).I am doing all things correctly but don't know where I lack.I am using Flash Builder 4.6 and 64 bit machine.I made the sample extension POC for android ,they are working fine.No such issue.
Please post your valuable comments.Eagerly waiting for reply.
ThanksHi,
Finally I got the answer to my problem.Actually I dont have the dependency dll of .net framework 4.So I nstall these and now my code is working fine.
Thanks -
Any good Native extensions for iOS yet?
Hi,
I wonder if there are any usable native extensions around yet for iOS features?
I have only found these: http://www.adobe.com/devnet/air/native-extensions-for-air.html which seems to be mostly tech-demos (battery, network info etc). I thought at least in-app-purchases, Game Center support, iAds, alertbox etc should have been released by now?
Since I have no knowledge in objective-c I can't do it myself, but I would gladly pay for ANE-files that are usable in real projects.
/Karlhttp://code.google.com/p/flash-for-mobile/
qq讨论群:56892018
version for iphone and ipad https://github.com/lilili87222/admob-for-flash
this is a actionscript native extension for developer to ad advertisement to their air mobile application run on iphone or android.it very easy to use
admob for flash android this lib enable you to add admob ad to your flash air application to add native advertisement to your actionscript3 application you just need to do four step
1.replace D:\Program Files\Adobe\Adobe Flash Builder 4.6\sdks\4.6.1\lib\android\lib\resources\android-res.jar with android-res.jar
2. add this config to -app.xml
<android>
<manifestadditions><![CDATA[
<manifest android:installLocation="auto"> <uses-sdk android:targetSdkVersion="11"/> <uses-sdk android:minSdkVersion="8"/> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <application><!-- <activity android:name="com.google.ads.AdActivity?" android:configChanges="keyboard|keyboardHidden|orientation"/> --> <activity android:name="com.google.ads.AdActivity?" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize |smallestScreenSize"/>
</application>
Unknown end tag for </manifest>
]]></manifestadditions>
</android>
3.add this config to -app.xml
<extensions>
<extensionid>so.cuo.ane.Admob</extensionid>
</extensions>
4. add code to your android air application like follow
test1(); private function test1():void { var admob:Admob=Admob.getInstance(); if(admob.isSupported){ admob.setUnitId(gid); admob.dispatcher.addEventListener(AdEvent?.onReceiveAd,this.adHandler); admob.dispatcher.addEventListener(AdEvent?.onFailedToReceiveAd,this.adHandler);
// admob.showRelation(AdMobAlignment?.ALIGN_BOTTOM,AdType?.BANNER);
admob.show(50,100,AdType?.BANNER);
}else{ trace("not support"); }
protected function adHandler(event:AdEvent?):void { trace("receive ad"); } -
Air Native Extension for OS X. Cant call functions from native code.
Hi, I am trying to build native extension for OS X.
After creating context, I try to call native function with "call" method, but always I have an error "The extension context does not have a method with the name ..."
In as3 code my ExtensionContext is not null, so it's okay. And in native objective-c code I have a function, which I call in as3 code.
What should I do?
Here my code.
Objective-c:
FREContext AirContext = nil;
FREObject init(FREContext ctx, void* funcData, uint32_t argc, FREObject argv[])
return nil;
FREObject someFunction(FREContext ctx, void* funcData, uint32_t argc, FREObject argv[])
FREDispatchStatusEventAsync(AirContext ,(uint8_t*) "SOME_EVENT", (uint8_t*) "some information" );
return nil;
void ANEContextInitializer(void* extData, const uint8_t* ctxType, FREContext ctx, uint32_t* numFunctionsToTest, const FRENamedFunction** functionsToSet)
NSLog(@"Entering ContextInitinalizer()");
*numFunctionsToTest = 5;
FRENamedFunction* func = (FRENamedFunction*) malloc(sizeof(FRENamedFunction) * *numFunctionsToTest);
func[0].name = (const uint8_t*) "init";
func[0].functionData = NULL;
func[0].function = &init;
func[1].name = (const uint8_t*) "someFunction";
func[1].functionData = NULL;
func[1].function = &someFunction
// other blank functions
*functionsToSet = func;
AirContext = ctx;
FREDispatchStatusEventAsync(AirContext ,(uint8_t*) "SOME_EVENT", (uint8_t*) "some information" );
void ContextFinalizer(FREContext ctx) {
NSLog(@"Entering ContextFinalizer()");
NSLog(@"Exiting ContextFinalizer()");
void ANEInitializer(void** extDataToSet, FREContextInitializer* ctxInitializerToSet, FREContextFinalizer* ctxFinalizerToSet )
NSLog(@"Entering ExtInitializer()");
*extDataToSet = NULL;
*ctxInitializerToSet = &ContextInitializer;
*ctxFinalizerToSet = &ContextFinalizer;
NSLog(@"Exiting ExtInitializer()");
void ANEFinalizer(void* extData)
return;
ActionScript3:
public class MyANE extends EventDispatcher{
private static var _instance:MyANE;
private var extCtx:ExtensionContext;
public function MyANE()
if (!_instance)
if (this.isSupported)
extCtx = ExtensionContext.createExtensionContext("my.awesome.ane", null);
if (extCtx != null)
trace('context is okay'); //this trace works
extCtx.addEventListener(StatusEvent.STATUS, onStatus);
} else
trace('context is null.');
_instance = this;
else
throw Error('singleton');
public static function getInstance():MyANE
return _instance != null ? _instance : new MyANE();
public function get isSupported():Boolean
var value:Boolean = Capabilities.manufacturer.indexOf('Macintosh') > -1;
trace(value ? 'supported' : 'not supported ');
return value;
private function onStatus(event:StatusEvent):void
trace('Event', event, 'code', event.code, 'level', event.level); //this traсе does not works
private function test(): void
extCtx.call("someFunction"); //this throws error
XML:
<extension xmlns="http://ns.adobe.com/air/extension/3.9">
<id>my.awesome.ane</id>
<versionNumber>1.0.0</versionNumber>
<platforms>
<platform name="MacOS-x86">
<applicationDeployment>
<nativeLibrary>MyANE.framework</nativeLibrary>
<initializer>ANEInitializer</initializer>
<finalizer>ANEFinalizer</finalizer>
</applicationDeployment>
</platform>
</platforms>
</extension>
And this script Im using for build ANE:
mv ../as3/bin/MyANE.swc .
unzip MyANE.swc
mv library.swf mac/
rm catalog.xml
rsync -a ../Obective-C/ANE/Build/Products/Debug/ANE.framework/ mac/ANE.framework/
adt -package -target ane MyANE.ane extension.xml -swc MyANE.swc -platform MacOS-x86 -C mac .
mv MyANE.ane ~/Work/_Projects/test/libs-ane/I haven't done Objective C in a long time, but if I'm not mistaken, it requires the semicolon to terminate a line of code. The line containing "func[1].function = &someFunction" does not have that termination and since that is the function you are trying to execute, maybe that is the source of the error.
-
Some iOS Native extensions that can be useful
Hi,
I have made some iOS Native extensions that can be useful.
You can find it at https://github.com/xperiments?tab=repositories
ANE7z
=> Adobe AIR iOS Native Extension to decompres 7z files.
ANEZipFile
=> Adobe AIR iOS Native Extension to zip/unzip files.
ANEFileSyncInterface
=> A micro http server with FileManagement capabilities Native Extension
IOSSystemUtils
=> Adobe Air IOS Native Extension to control Brightness / Torch / Badge
ANEUnRar
=> Adobe Air Native Extension to Obj-C UnRar Lib
Please give me your commentsFirst of all, thank you for creating this extension. However, it doesn't seem to work. Below is my code for decompressing ByteArray (error handling is stripped for simplicity):
public function decompress(aData:ByteArray):ByteArray {
// Save data to file
var fileInput:File = File.applicationStorageDirectory.resolvePath("input.7z");
var stream:FileStream = new FileStream();
stream.open(fileInput, FileMode.WRITE);
stream.writeBytes(aData);
stream.close();
var folderOutput:File = File.applicationStorageDirectory.resolvePath("output");
ANE7z.decompress(fileInput, folderOutput);
var files:Array = folderOutput.getDirectoryListing();
for each (var fileOutput:File in files) {
trace("Extracted file: " + fileOutput.nativePath);
if (!fileOutput.isDirectory) {
var bytes:ByteArray = new ByteArray();
stream = new FileStream();
stream.open(fileOutput, FileMode.READ);
stream.readBytes(bytes);
stream.close();
bytes.position = 0;
return bytes;
return null;
The problem is folderOutput.getDirectoryListing() always returns an empty array. -
IOS Native Extension with external Framework
Hi there,
I am developing a native extension for iOS based CityGrid framework. I compiled .a file and packaged it to ANE file. However when I am trying to compile the app, compiler shows me the error:
Error occurred while packaging the application:
Undefined symbols:
"_OBJC_CLASS_$_CityGrid", referenced from:
__objc_classrefs__DATA@0 in libcom.example.SomeAPI.a(SomeAPI.o)
ld: symbol(s) not found
Compilation failed while executing : ld64
I tried few options in XCode. However I still have the error.
Is anybody tried to do a native extension with external frameworks?How did you compile your ane file? I met same issue before.
adt -package -target ane myextension.ane extension.xml -swc mySwc.swc -platform iPhone-ARM library.swf libmylib.a -platformoptions myplatformoptions.xml
lnside myplatformoptions.xml, I linked all the framework and shared libraries, as following
<platform xmlns="http://ns.adobe.com/air/extension/3.1">
<sdkVersion>5.1</sdkVersion>
<linkerOptions>
<!-- to use the CoreMotion framework -->
<option>-framework CoreMotion<option>
<!-- to link with the libiconv.dylib -->
<option>-liconv</option>
</linkerOptions>
</platform>
Please let me know, if it does work. -
Adobe Air native extension for admob
Dear Adobe Team,
We have recently purchased Adobe Air native extension for admob for android & ios
but every time we upload our app to an ipad or iphone, the app crashes.
We have carefully followed your instructions, and we're sure we've not made a mistake writing the action script 3 code.
We need your help in solving this problem urgently, as we are now running behind schedule in uploading our app.
Thanks very much,
Amir Steklov and Dorit LeshnickBefore I was also searched a lot to find good add network and also Admob.
Finally we done successfull integration using.. working fine in all IOS devices. not yet released to Apple app store
http://code.google.com/p/flash-air-admob-ane-for-ios/source/browse/trunk/admobaneiphone/sr c/admobtest.as?r=2
You can check our add setups using Air ANE's for our android game ExpressTrain.
https://play.google.com/store/apps/details?id=air.timuzsolutions.expresstrain&feature=sear ch_result#?t=W251bGwsMSwyLDEsImFpci50aW11enNvbHV0aW9ucy5leHByZXNzdHJhaW4iXQ..
you no need to buyAdobe Air ANE's everything is free but all u need to do is googling,
hope this will help.
Bala
Message was edited by: vamsibalu -
Developing and using Adobe AIR native extensions for Android devices
I was using this tutorial:
"Developing and using Adobe AIR native extensions for Android devices"
http://www.adobe.com/devnet/air/articles/ane-android-devices.html
When packing the Flex mobile ANESampleTest to deploy on an Android device, the below error happens
Error occurred while packaging the application:
aapt tool failed:invalid resource directory name: /private/var/folders/k8/1thhvkf92h947n_g22hg_v9m0000gn/T/52ba05aa-9001-4d46-9438-db81ef83 06f0/res/drawable-xxhdpi
invalid resource directory name: /private/var/folders/k8/1thhvkf92h947n_g22hg_v9m0000gn/T/52ba05aa-9001-4d46-9438-db81ef83 06f0/res/values-sw600dp
invalid resource directory name: /private/var/folders/k8/1thhvkf92h947n_g22hg_v9m0000gn/T/52ba05aa-9001-4d46-9438-db81ef83 06f0/res/values-sw720dp-lan
Does anyone know what the issue might be?Did you find a workaround for the Error? I'm getting the same and I can't seem to find any solution.
-
Native extension for Game Center
Hi guys,
As I understand it with the latest Air Beta it's possible to implement native extensions for iOS, and in theory that would make it possible to connect to both Game Center and in-app purchases.
Has anyone here tested this? It would be nice to know if there are any show stoppers before I start "digging"...
Cheers,
/AndreasI just finished an extension for AIR that adds Game Center (commercial.) I'm going to be doing Multiplayer next. I'm pretty sure there's an in app purchase one out there, I'm looking for it now, I'll post if i find it.
-
External library inside Air native extension for android
Hello everyone,
First, I've been looking throught this topics
- http://stackoverflow.com/questions/7732742/air-3-native-extensions-for-android-can-i-how-t o-include-3rd-party-libraries
- http://stackoverflow.com/questions/24626380/how-to-include-additional-jar-in-android-nativ e-extension-for-adobe-air-mobile
I got a similar problem. But not exactly the same. And the solution didn't worked for me :(.
First of all, I don't have any visible error.
-I can easily talk between java and action script.
-The gateway is set without problems.
My problem comes when, from my java-side-part of the extension, I try to call a 3rd party library. This library is (and I think this is where I do something wrong) linked to my project as an external lib, in .jar format.
So when I make a call to 3rd party library, it just doesn't print anything. Neither on the adobe part or on the java part. The logs that are before my call are printed but not the ones after.
I tried different solutions that are:
-Taking all compiled class files of my external lib and add it inside the main native extension jar [link1]
same result (no errors)
-including the 3rd party jar inside the ANE by adding a dependence file that require the .jar [link2]
with this method i got this error that I don't get
> aapt tool failed:ERROR: input directory '--auto-add-overlay' does not exist
My third party library also include's itself some external .jars so do I need to include every jars inside the same packaged jar?
I can see that a lot of people are dealing with issues like that so my question would be:
What is the best way to include 3rd party library inside android AIR Native Extension ?.
For information, here is what I do to create the ANE
>adt -package -target ane AirInfinitGameANE\AirInfinitGame.ane AirInfinitGameASLib\src\extension.xml -swc AirInfinitGameANE\AirInfinitGameASLib.swc -platform Android-ARM -C AirInfinitGameLib .
- AirInfinitGameASLib: just the folder with the actionScript part and the config xml file
- AirInfinitGameANE: folder in the one that will be the native extension
- AirInfinitGameLib: the eclipse java project. I need to put in that folder the airInfinitgamelib.jar(extension jar) and the library.swf (from the swc file) in order to beeing able to compile the ANE.
Here it is ! Thanks a lot for thoses who'll read me.I had the same problem recently and fixed it as follows;
- Extract the 3rd party jar file and copy the class folder (usually named "com" in the root of the jar) to my project.
- Under Project Properties -> Java Build Path -> Libraries click "Add class folder" and add the "com" folder you just extracted from your .jar.
Hope this helps -
Сertificate exception when building iOS native extension
I have certificates for developer and distribution . I signed AIR apps using those certificates, and all work (I publiched 5 games to AppStore, all OK).
But when I try to compile an iOS native extension, I get:
Unable to build a valid certificate chain for the signer extension.
Can someone help me, please? All my attempts failed to fix it.How did you compile your ane file? I met same issue before.
adt -package -target ane myextension.ane extension.xml -swc mySwc.swc -platform iPhone-ARM library.swf libmylib.a -platformoptions myplatformoptions.xml
lnside myplatformoptions.xml, I linked all the framework and shared libraries, as following
<platform xmlns="http://ns.adobe.com/air/extension/3.1">
<sdkVersion>5.1</sdkVersion>
<linkerOptions>
<!-- to use the CoreMotion framework -->
<option>-framework CoreMotion<option>
<!-- to link with the libiconv.dylib -->
<option>-liconv</option>
</linkerOptions>
</platform>
Please let me know, if it does work. -
In App Purchase Native Extension for Android
Hi All
I was wondering whether anyone has done any work on an In App Purchase native extension for Android? If one does not already exist I am going to be starting work on one shortly.
I did a google search and found this stackoverflow post http://stackoverflow.com/questions/8053049/air-native-extensions-for-android-in-app-billin g . The poster is having difficulty with the call back from the Android market. One of the responses mentions that 'Native extensions have an issue with java libraries' . Has anyone else come across this issue and if so how did you fix it?
thanks for any help you can provide!
MarkI have just finished a (commercial) extension that lets you directly do in-app purchases on android from Actionscript 3. You can check it out here.
-
Using OpenCV inside an Adobe Native Extension for IOS
I'm trying to use OpenCV.framework inside an Adobe Native Extension that I'm developing to use on an IOS application made in Flex.
The problem is that I get errors while packaging the application:
Undefined symbols for architecture armv7:
"__ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv", referenced from:
__ZNSt3__16vectorIiNS_9allocatorIiEEE8__appendEm in opencv2(smooth.o)
__ZNSt3__16vectorIN2cv6Point_IiEENS_9allocatorIS3_EEE21__push_back_slow_pathIKS3_EEvRT_ in opencv2(hough.o)
__ZNSt3__16vectorIN2cv3VecIiLi128EEENS_9allocatorIS3_EEE8__appendEm in opencv2(matrix.o)
__ZNSt3__16vectorIN2cv3VecIiLi64EEENS_9allocatorIS3_EEE8__appendEm in opencv2(matrix.o)
__ZNSt3__16vectorIN2cv3VecIiLi32EEENS_9allocatorIS3_EEE8__appendEm in opencv2(matrix.o)
__ZNSt3__16vectorIN2cv3VecIiLi16EEENS_9allocatorIS3_EEE8__appendEm in opencv2(matrix.o)
__ZNSt3__16vectorIN2cv3VecIiLi12EEENS_9allocatorIS3_EEE8__appendEm in opencv2(matrix.o)
ld: symbol(s) not found for architecture armv7
Compilation failed while executing : ld64
and this is the platformoptions.xml I use to compile the ANE:
<platform xmlns="http://ns.adobe.com/air/extension/4.0">
<sdkVersion>8.0</sdkVersion>
<linkerOptions>
<option>-framework opencv2</option>
<option>-framework UIKit</option>
<option>-framework Foundation</option>
<option>-framework CoreGraphics</option>
<option>-framework Accelerate</option>
<option>-framework AssetsLibrary</option>
<option>-framework AVFoundation</option>
<option>-framework CoreImage</option>
<option>-framework CoreMedia</option>
<option>-framework CoreVideo</option>
<option>-framework QuartzCore</option>
</linkerOptions>
</platform>
Any idea?Problem solved. I've added this line
<option>-lc++</option>
to the platformOptions.xml.
Now OpenCV works great in my actionscript native extension.
Maybe you are looking for
-
Yoga 2 Pro "plugged in, charging" even when running on battery
A few weeks ago, my Yoga 2 Pro entered a permanent "plugged in, charging" state whether plugged in or running on just the battery. The battery drains as normal, it just always shows the plugged in icon. It also charges as normal. When I turn it off,
-
I restore and itunes tells me to restore on and on
Whwn I connect my 2nd gen nano to the usb port, it says on its display not to disconnect, after a brief moment a dialogue window appears on itunes and tells my to restore, confirmation window appears: "are you sure...?" - yes - it restores, the apple
-
Case management - BAPI_CASE_CREATE, BAPI_CASE_ADDELEMENTS
Hi, I want to create case with linked objects. I can link business partner, account .. but i can't link other case as case item. I have always error message Internal error: class CL_SCMG_CASE_API; method ELEMENT_INSERT. I use the same kind of paramet
-
Approval in two days -- question about direct link to store
My first iBook was approved in two days, but I have what is probably a simple question but I can not find the answer anywhere. I want to get a url to direct people to the book, how do I get this?
-
How can i listen to radio when the ipod nano is placed in a dockingstation?
The radio antenna is integrated in the earphones. But the earphonesocket is placed on the buttom of the ipod and must be removed when placed in the dockingstation. Without antenna no radio. Do wee need a special dockingstation adapter with antenna fo