Use native extensions

This question was posted in response to the following article: http://help.adobe.com/en_US/flashbuilder/using/WSe4e4b720da9dedb5-2e7310a1136ab7c1811-8000 .html

Sorry, I don't know anything about hideAneLibSymbols.
I too was having lots of resource missing problems until today. The following page is a must read for ane development. Solved all kinds of problems for me.
http://www.adobe.com/devnet/air/articles/ane-android-devices.html
In a nutshell, if I understand correctly, you'll do a "regular" export of your android jar file with your resources included (except for the res/xxhpdi sub-folder - if you have one. The actionscript side doesn't like this folder. Mmm, but maybe it would if I'd had a matching icon of the same size on the native side - I'll have to check on that.)
I have a 'build' folder with 2 sub folders: android and default. (A setup very similar to the one discussed in the above article.)
You'll put the jar file and a copy of the res folder (also excluding the xxhdpi sub-folder) into the android folder.
  (Yes you're doubling up your native resources in your ane file, but the resources in the jar will get stripped out and tossed when it gets merged into your app's final APK file.)
I use a build batch file that pulls everything in from each sub folder using: -C android .
(notice the period at the end)
I think when I was having the error similar to yours was when I was trying to NOT double up the resources in the ane file and was exporting the jar without them. That won't work.
For quite awhile I was having the opposite problem. I wasn't doubling up the resources, the ane file when "unzipped" looked fine, but android logcat kept reporting missing resource exceptions when running my test app via USB on my mobile device. When I finally stepped back and "unzipped" my apk file, sure enough, my native resources were gone and only the default Actionscript resources remained.
Oh, and for Windows development I highly recommend 7Zip. It recognizes any file that's a zip no matter its file extension. I just right-mouse drag to a folder, select 7zip->extract here from the context menu, and it just works.
Here's a copy of my windows batch file in case it helps anyone. It's from a sample project I rebuilt based off of mr_archano's
sample SMS ane (on the Adobe ANE webpage):
:: Builds ane after file all the necessary files have already been copied into place.
:: Separate batch file that sets the path to may current AIR SDK
call c:\bin\setAIRpath.bat
:: Target name
set targName=Archano.ane
set extxml=extension.xml
set swcName=ArchanoLib.swc
:: Substitute your own p12 file here
set certP12=\Flash/MyGamesInc.p12
:: Change pwd as needed.
set pwd=useyourownpwd
set paccmd=adt
%paccmd% -package -storetype pkcs12 -keystore %certP12% -storepass %pwd% -target ane %targName% %extxml% -swc %swcName% -platform Android-ARM -C android . -platform default -C default .
Also, I built using the AIR 3.7 SDK overlaid as per the doc above describes (although it used AIR 3.6)
The only problem I've having now is that my apk just jumped from 1.5Mb to 11.7Mb. Ouch.
I tried rolling my targeted platform from 20 back to -swf-version=14 but that doesn't seem to have helped.
Back to scanning the forums for help on that one. *sigh*

Similar Messages

  • Signed air installer while using native extensions

    I'm using a native extension for network discovery, with different implementations for each platform.  But I can't build my signed air installer... so my question is:
    Is it possible to build a signed air installer while using native extensions? If not; when (if ever) will support for this be added?

    Needs updating for FB 4.6 and FB 4.7.

  • Unable To Build iOS App Using Native Extension

    I’m trying to create a native extension for iOS and use that extension as part of an IPA app for iOS I create from a SWF file using the ADT tool (i.e. the normal use-case for iOS). Note: I have already successfully created the native extension and APK app for Android and now I am trying to build the iOS side.
    I have been primarily using the information found at the following websites:
    http://www.adobe.com/devnet/air/articles/building-ane-ios-android-pt3.html
    http://www.adobe.com/devnet/air/articles/building-ane-ios-android-pt5.html
    http://help.adobe.com/en_US/air/build/WS901d38e593cd1bac35eb7b4e12cddc5fbbb-8000.html
    I have also searched the Adobe forums for the answer to my question without success.
    The error I receive is:
    ld: warning: ignoring file /var/folders/c3/mpg4frwn2j1f8scw4jctbmv9hfkswj/T/bd3fbd4a-cf56-4fd6-a06d-d69ea92dc620/lib com.mycompany.MyExtension.a, file was built for archive which is not the architecture being linked (armv7): /var/folders/c3/mpg4frwn2j1f8scw4jctbmv9hfkswj/T/bd3fbd4a-cf56-4fd6-a06d-d69ea92dc620/lib com.mycompany.MyExtension.a
    Undefined symbols for architecture armv7:
      "_MyExtensionInitializer", referenced from:
          _g_com_adobe_air_fre_fmap in aotInfo.o
      "_MyExtensionFinalizer", referenced from:
          _g_com_adobe_air_fre_fmap in aotInfo.o
    ld: symbol(s) not found for architecture armv7
    Compilation failed while executing : ld64
    I receive the above error when I execute the following command:
    adt -package -target ipa-ad-hoc -storetype pkcs12 -keystore certificate.pfx -provisioning-profile provisioning_profile.mobileprovision MyApp.ipa MyApp.xml MyApp.swf -extdir packaged-extensions
    where the folder “packaged-extensions” contains the ANE file I created using this command:
    adt -package -target ane packaged-extensions/MyExtension.ane MyExtension.xml -swc MyExtension.swc -platform Android-ARM -platformoptions platformAndroidARM.xml -C dependencies . -C platform/Android . -platform iPhone-ARM -platformoptions platformiOSARM.xml -C platform/IOS . -platform default -C platform/default library.swf
    where the content of the files are as follows:
    MyApp.xml:
    <application xmlns="http://ns.adobe.com/air/application/4.0">
        <id>MyApp</id>
        <versionNumber>0.0.1</versionNumber>
        <filename>MyApp</filename>
        <initialWindow>
            <content>MyApp.swf</content>
            <visible>true</visible>
            <width>600</width>
            <height>600</height>
        </initialWindow>
        <supportedProfiles>mobileDevice</supportedProfiles>
            <extensions>
                    <extensionID>com.mycompany.MyExtension</extensionID>
            </extensions>
    </application>
    MyExtension.xml:
    <extension xmlns="http://ns.adobe.com/air/extension/4.0">
            <id>com.mycompany.MyExtension</id>
            <versionNumber>0.0.1</versionNumber>
            <platforms>
                    <platform name="Android-ARM">
                            <applicationDeployment>
                                    <nativeLibrary>MyExtension.jar</nativeLibrary>
                                    <initializer>com.mycompany.MyExtension</initializer>
                            </applicationDeployment>               
                    </platform>
                    <platform name="iPhone-ARM">
                            <applicationDeployment>
                                    <nativeLibrary>libMyExtensionIOSLibrary.a</nativeLibrary>
                                    <initializer>MyExtensionInitializer</initializer>
                                    <finalizer>MyExtensionFinalizer</finalizer>
                            </applicationDeployment>
                    </platform>
                    <platform name="default">
                            <applicationDeployment/>
                    </platform>
            </platforms>
    </extension>
    platformiOSARM.xml:
    <platform xmlns="http://ns.adobe.com/air/extension/4.0">
      <linkerOptions>
        <option>-ios_version_min 5.1</option>
        <option>-liconv</option>
      </linkerOptions>
    </platform>
    MyExtensionIOSLibrary.m (yes, I know it doesn't do anything - it's simple on purpose to help isolate the error):
    #import "FlashRuntimeExtensions.h"
    void MyContextInitializer(void* extData, const uint8_t *ctxType, FREContext ctx, uint32_t *numFunctionsToTest, const FRENamedFunction **functionsToSet) {
      return;   
    void MyExtensionInitializer(void **extDataToSet, FREContextInitializer* ctxInitializerToSet, FREContextFinalizer* ctxFinalizerToSet) {
        *extDataToSet = NULL;
        *ctxInitializerToSet = &MyContextInitializer;
    void MyExtensionFinalizer(void *extData)
        return;
    I am using XCode to build MyExtensionIOSLibrary.m into a library file with a .a filename extension. My relevant build settings are:
    iOS Deployment Target: iOS 5.1
    Architectures: armv7
    Build Active Architectures Only: No
    Product Scheme: Release
    Compile Sources As: Objective-C
    Any ideas? Please help.

    Thanks for the reply.
    yes.I've created a static library with 3rd party frameworks and pulled the .a from product folder(Debug-iphoneos).
    and the framework didn't work(armv7 not supported error occurs ..don't know why) with it's original folder structure .
    so I followed below link to change folders inside the 3rd party framework and figured out but now  the application crashes on startup without giving an error message. .
    スタッフ日記 - 【ANE作成】外部フレームワーク を含むANE作成時の注意点(iOS) | 株式会社マリエッタ

  • Problems using Native Extensions (Gyroscope) for iOS.

    I have downloaded the Gyroscope Native Extension for Air and I'm basically trying to install it so I can use the extensions to develop an iOS AIR app that uses my iPhone's Gyroscope.
    The Gyroscope Folder has been un-zipped and is placed in a folder alongside the AIR app that I'm developing. I've set the Actionscript settings to point to the gyroscope.ane file and also to the gyroscope.swc file.I don't know if the latter is necessary as I'm all new to this.
    My Actionscript reads:-
    import com.adobe.nativeExtensions.Gyroscope;
    import com.adobe.nativeExtensions.GyroscopeEvent;
    import com.adobe.nativeExtensions.GyroscopeIntervalValue
    var gyro:Gyroscope;
    if(Gyroscope.isSupported)
        gyro = new Gyroscope();
        gyro.setRequestedUpdateInterval(1000);
        gyro.addEventListener(GyroscopeEvent.UPDATE,onChange);
    function onChange(e:GyroscopeEvent):void
        trace("From gyro: " + e.x + " " + e.y + " " + " " + e.z);
    Which I've basically taken from the webpage https://www.adobe.com/devnet/air/native-extensions-for-air/extensions/gyroscope.html#artic lecontentAdobe_numberedheader
    And I've added the 3 imports at the top because I believe these should allow these functions / methods (or whatever they are called) to work ?
    Unfortunately I'm getting the following errors:-
    GyroscopeEvent.as, Line 1
    5001: The name of package 'com.adobe.nativeExtensions' does not reflect the location of this file. Please change the package definition's name inside this file, or move the file. /Users/myname/Desktop/programFolder/GyroscopeEvent.as
    Gyroscope.as, Line 1
    5001: The name of package 'com.adobe.nativeExtensions' does not reflect the location of this file. Please change the package definition's name inside this file, or move the file. /Users/myname/Desktop/programFolder/Gyroscope.as
    I don't know where to move the files or how I can get AIR to see this .as files Should I be moving the "Com" folder somewhere better ?
    I'm a relative newbie to AIR so I appologise for my ignorance. All I want is a way to get access to the x y and z values from the Gyroscope.
    Many Thanks
    Gary

    Remove the gyroscope folder. The only file you need is Binaries/Gyroscope.ane.
    If you are using Flash CS6 link to the ane file not the swc file in the publish settings.
    Also remove the line: import com.adobe.nativeExtensions.GyroscopeIntervalValue.
    Sample code that you can use is in the file Eg/src/Eg.mxml.

  • Using native extensions for Adobe AIR

    This question was posted in response to the following article: http://help.adobe.com/en_US/air/build/WS597e5dadb9cc1e0253f7d2fc1311b491071-8000.html

    Needs updating for FB 4.6 and FB 4.7.

  • Native extensions and captive runtime

    I'm trying to use native extensions and captive runtime. When I try to create a release, the IDE shows this message "Native extensions are being used in the project but are not supported by the CAPTIVE_RUNTIME_BUNDLE package type. Runtime issues can occur." and I can't continue.
    I've been able to compile it using the command-line, but I'm worried about the "runtime issues" that can occur.

    Hi,
    Sorry, just verified that export release build, with Native Extensions and Captive Runtime bundled for Desktop projects has been fixed and is available in the final release of Flash Builder 4.7.
    Thanks,
    Hari

  • Is it possible to access an AIR Native Extension inside an Actionscript worker?

    Hi, I'm currently trying to push off some time consuming tasks to an actionscript worker. This worker will in turn needs to call out to an AIR Native Extension as part of it's processing.
    I've tried various combination in Flash Builder 4.7 i.e. embedded worker and external worker (with explicit packaging of the ANE in the external worker project)  but alas I've been unable to get this to setup to work. I keep getting an error from the worker saying that the native extesion class could not be found (Error #1014).
    Does anyone know if it is at all possible to do this or it's a limitation of Actionscript workers (loading thw swf bytes does not load up the ANE)?

    Hi
    I also met the same problem---"native extesion class could not be found"
    The problem is solved?
    I think the reason is
    " <extensions>
      <extensionID>XXXXXX</extensionID>
    </extensions>“ in  "-app.xml"
    the worker do not  konw the extensionID
    In this article :
    Adobe AIR * Using native extensions for Adobe AIR
    Including the ANE file in your application’s library path
    To compile an application that uses a native extension, include the ANE file in your library path.
    Using the ANE file with Flash Builder
    If your application uses a native extension, include the ANE file for the native extension in your library path. Then you can use Flash Builder to compile your ActionScript code.
    Do the following steps, which use Flash Builder 4.5.1:
    Change the filename extension of the ANE file from .ane to .swc. This step is necessary so that Flash Builder can find the file.
    Select Project > Properties on your Flash Builder project.
    Select the Flex Build Path in the Properties dialog box.
    In the Library Path tab, select Add SWC....
    Browse to the SWC file and select Open.
    Select OK in the Add SWC... dialog box.
    The ANE file now appears in the Library Path tab in the Properties dialog box.
    Expand the SWC file entry. Double-click Link Type to open the Library Path Item Options dialog box.
    In the Library Path Item Options dialog box, change the Link Type to External.
    Now you can compile your application using, for example, Project > Build Project.
    the error will be done
    Unfortunately, it still does not work well!
    Error: Error #3731: This feature is not available within this context.
      at flash.external::ExtensionContext$/_createExtensionContext()
      at flash.external::ExtensionContext$/createExtensionContext()
    3731
    This feature is not available within this context.
    This error occurs if a background worker attempts to access an API that is not available to it. 
    Run-Time Errors - Adobe ActionScript® 3 (AS3) API Reference

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

  • Has anyone anywhere managed to get "AIR Native Extensions" to work with Flash CS 5.5?

    I'm trying to integrate Adobe's "Gyroscope" example of ANE to work from Flash Professional CS 5.5.
    http://www.adobe.com/devnet/air/native-extensions-for-air/extensions/gyroscope.html
    Apparently, one has to use the somewhat crude "ADT" command-line tool to build an app that uses Native Extensions.
    Unfortunately, I cannot get past the numerous errors ADT is throwing at me.  The latest is:
    unexpected failure: inputs not set
    java.lang.IllegalStateException: inputs not set
              at com.adobe.air.ApplicationPackager.createPackage(ApplicationPackager.java:62)
              at com.adobe.air.ADT.parseArgsAndGo(ADT.java:556)
              at com.adobe.air.ADT.run(ADT.java:413)
              at com.adobe.air.ADT.main(ADT.java:463)
    Unfortunately, I'm not an advanced developer, so I really don't know what any of that means. (But I'm sure if I can just get this one example to compile and run, I'll be better able to perform the necessary tasks in the future.)
    Can someone PLEASE help me?
    Thanks.
    Mike

    If you are looking for input from others, you are more likely to find people with either similar problems or complaints in the Flash General Forum (http://forums.adobe.com/community/flash/flash_general?view=discussions) rather than here in the Actionscript 3 forum.  If you scan thru it for the past few weeks/months you might even find someone with the same problem.

  • Utilizing AIR Native Extensions in Flash Pro CS5.5

    I'm trying to integrate Adobe's "Gyroscope" example of ANE to work from Flash Professional CS 5.5.
    http://www.adobe.com/devnet/air/native-extensions-for-air/extensions/g yroscope.html
    Apparently, one has to use the somewhat crude "ADT" command-line tool to build an app that uses Native Extensions.
    Unfortunately, I cannot get past the numerous errors ADT is throwing at me.  The latest is:
    unexpected failure: inputs not set
    java.lang.IllegalStateException: inputs not set
              at com.adobe.air.ApplicationPackager.createPackage(ApplicationPackager.j ava:62)
              at com.adobe.air.ADT.parseArgsAndGo(ADT.java:556)
              at com.adobe.air.ADT.run(ADT.java:413)
              at com.adobe.air.ADT.main(ADT.java:463)
    Unfortunately, I'm not an advanced developer, so I really don't know what any of that means. (But I'm sure if I can just get this one example to compile and run, I'll be better able to perform the necessary tasks in the future.)
    Can someone PLEASE help me?
    Thanks.
    Mike

    Joe_suchta, you can follow these steps http://www.youtube.com/watch?v=pwVkK27Nors
    Lucky

  • Testing Unsupported Native Extensions in Flash CS6

    I'm currently working on an iOS application using Flash CS6 Pro targeting the AIR 3.3.0.3560 SDK. In order to compile using the iOS 5.1 SDK (to support retina displays) from Flash CS6 it's necessary to add in a native extension in order to specify the iOS SDK location.
    I've add the 'Vibration' native extension (com.adobe.extensions.Vibration.ane) library to my project, and of course supplied the full path to the iOS SDK. Publishing to the device works just fine, but an issue has crept into my everyday workflow as I can no longer test using ADL as I always get the following error via the output window:
    "Test Movie terminated.
    The content cannot be loaded because there was a problem loading an extension: Error: Requested extension com.adobe.Vibration is not supported for MacOS-x86."
    Any ideas how to go about testing apps/movies that use Native Extensions locally using ADL?
    Is it a matter of having to create another target for 'MacOS-x86' (or Windows) which is simply used for local testing purposes?
    BTW - ideally it would be possible to compile from Flash CS6 using the iOS SDK without having to specify a native extension (if one isn't required), but in the meantime this appears to be a necessary evil.

    Hi,
    Its probably because the number of warnings in your application is very high and its a known issue that packaging fails in Flash Pro/Flash Builder, if the number of warnings is high.
    You may want to suppress the warnings using -w in the platform.xml file and repackage your ANE using the -platformoptions switch. Then, you will be able to package your app in Flash Pro.
    If that’s not possible, you may just package your application on command line.
    Hope that solves your problem.
    Neha

  • Actionscript 3 - Air and Native Extensions?

    I have a Flash AS3 app that I want to run on android phones via AIR.  Can I use native extensions?  If so, how can I include the .ane files?  To reiterate, I just have a regular Flash + AS3 project- not a mobile project.  I'm not doing anything with XML.  Anyone have an answer to this?
    Thanks!

    you include the ane file by clicking file>publish settings>swf>advanced actionscript settings (the wrench icon)>library path>browse to an ane file (4th or 5th icon at the top of the library path panel).

  • Native Extensions don't work in Flash CS6

    Edit: Never mind.
    Whoever made the native extension, despite it being a useful function, used the abominable package naming structure of:
    com.coder.nativeExtensions.NameOfClass.NameOfClass
    Anybody going to use it would import com.coder.nativeExtensions.NameOfClass, in which case it would not work because the name of class is also the name of an extra package directory and you have to repeat it twice which makes no sense, but it works with the class name redundantly repeated twice in the import.
    I am on Flash Professional CS6. I upgraded it just so I could use Native Extensions. I have browsed and added the native extension to libraries. I have added the import statement and added the xml entry for extension ID.
    If I try to run it I get "Definition could not be found" error for the package import. There is a complete lack of documentation or any way to find out why it isn't working. All I get is an unhelpful error that doesn't address the actual problem.
    How do you get native extensions to work?

    There was nothing wrong with CS6 in this situation, it was that the package name of the specific extension I was trying to use that was horribly named, to the point you had to repeat the class name twice, which means most developers would only put it once and it wouldn't work. Being that this was the first native extension I tried to run, it seemed that the native extension feature didn't work.
    Say your name is Bob Smith and you make a native extension that runs your hardware camera as a flashlight.
    If you name the class FlashLight and the package name com.bobsmith.nativeExtensions.FlashLight
    people would have to put
    import com.bobsmith.nativeExtensions.FlashLight.FlashLight;
    or
    import com.bobsmith.nativeExtensions.FlashLight.*;
    to import it. And that woudldn't  make much sense. "FlashLight" is the name of the class. If the class and the package subdirectory have the exact same name, people are going to think the package subdirectory is the class.
    Most people trying to import it would put
    import com.bobsmith.nativeExtensions.FlashLight;
    or
    import com.bobsmith.nativeExtensions.*;
    in which case it wounld not work.
    A non-insane way to name your package would be com.bobsmith.nativeExtensions.hardware
    Then one could put
    import com.bobsmith.nativeExtensions.hardware.FlashLight;
    or
    import com.bobsmith.nativeExtensions.hardware.*;
    That would make sense, either importing the FlashLight hardware feature or all hardware features in the package.

  • Native Extensions fail in FlashCC Debugger

    I have a project using Native Extensions. While the project compiles and works fine on an Android device, when debugging I get a "Debugger failed to launch" error.
    Removing the native extension references solves the issue, so I assume it's that that causes the debugger crash.
    This is most regretable as the debugger opens a lot faster and provides better feedback than having to load the project up to a device.
    Is anyone working on this bug?

    Hi Peter,
    Could you please provide the exact steps and the OS details. I assume you are using "Debug-> Debug via USB" option to launch debugger on Android Device.
    Thanks and Regards,
    Meenakshi

  • Native Extensions in Workers

    Hello,
    I'm starting with Workers from Android. Seems to work well for simple tasks, however I can I use Native Extensions within workers ?

    Maybe I'm not explained myself very well. YES, I tested and tryed everything !
    I need two Workers:
    The first one is very simple and use sqlite and is working simple perfectly.
    The second one use one ANE that I created my self for integration with a bluetooth device. If I change the ANE to SWC and include this as a library, the SWF worker increase the size and recognize the AS3 classes however I got and error when the AS3-ANE try to instantiante the jar code part, because this is a SWC library and not an ANE anymore !
    Seems that ANEs are only supported in Flex Desktop/Flex Mobile projects and not librarys and the worker is.

Maybe you are looking for

  • Can not edit photos - cannot see photos after import from camera

    Hello all - Im having a very frustrating time getting Iphoto to work. First is that I can not edit photos double clicking photo - does not launch edit mode select photo and click edit pencil - does not launch edit mode Sometimes, however, edit mode i

  • Satellite Pro 6100, WXP installing SP2, after stand-by mode the USB is unknown

    Hi, after installing the update SP2 for Win XP on my notebook Toshiba Sat. Pro 6100, the following happens: when the notebook awakes from the stand-by mode, the USB connector is unknown and the communication is lost. Who knows the answer for this pro

  • Time to buy?

    OK, I've been waiting since June for Apple to iron out any problems with the MacBooks before I replace my 12" PowerBook G4. Are the newer models better? Is now a good time to buy? Looking to buy from John Lewis (UK) who offer a 2 year warrantee as st

  • Oracle 8.i Installation - FOR AIX 5 -

    Is Oracle 8i supported on AIX 5 (I know it is supported on AIX 4.3.3), but the install scripts do not seem to be coded for AIX5. Thanks Kevin Shaw dba e-result plc

  • Parsing MIME message

    Hi, I have a saved email message in MIME format. Some of the emails have attachments encoded using base64. I want to parse the message and extract these attachments. I started doing this in my class by looking for pattern only to realize that these m