Question

I've been working with the vibration example from Adobe for Air 3.0's native extensions on Android.

I have the ANE compiled and the .apk packaged.

The problem I'm having is the actionscript library is getting a null ExtensionContext.

I tried creating the .apk with adt -package -target apk-debug so that I can see the actionscript traces in logcat and that's where I'm finding the null error.

extContext = ExtensionContext.createExtensionContext("com.adobe.Vibration", null);

extContext is null and crashes on the following .call() method.

All of the source is stock from the examples, I haven't changed anything.

Does anyone have any experience with getting one of Adobe's ANE examples working on a windows machine? Most of the examples are for Mac.

Was it helpful?

Solution

Good lord. What a waste of a week.

I was using a tutorial from gotoandlearn.com that was telling me to, in by build script, use a jar command to put my native extension in to a jar.

I simply used the .jar that's automatically built in the NativeAndroid/bin/ folder and all is well.

It turns out, that tutorial is out dated and not really useful for the build anymore.

OTHER TIPS

One additional comment. You need to set target platform and checkbox Is Library from Properties -> Android to get compiled jar in bin folder.

P.S. .sh from gotoandlearn can be executed in Powershell in Windows with minor changes for running bat files: ( cmd "/c adt.bat" )

I'm having the exact same problem on a Native Extension I'm writing, and have open sourced. I started this project with tutorial code from Adobe DevNet. I've found examples of this specific issue I've tried to follow exactly, and have had no luck with it yet. I've identified it to be a sandbox allow-domain problem.

Here's my line of code:

_aneContext = ExtensionContext.createExtensionContext("com.adobe.sampleasextension", "");

Here is a link to the code in my GitHub project:

https://github.com/interactivenyc/ANESampleProject/blob/master/TEST_AndroidAIR/src/ANESampleTest.as

Here is my compiler error:

SecurityError: Error #3207: Application-sandbox content cannot access this feature.
    at flash.system::Security$/allowDomain()
    at com.adobe.sampleasextension::SampleASExtension()[/Users/stevewarren/Clients/Speakaboos/git_repositories/ANESampleProject/ANESampleSWC/src/com/adobe/sampleasextension/SampleASExtension.as:14]
    at ANESampleTest/initializeANE()[/Users/stevewarren/Clients/Speakaboos/git_repositories/ANESampleProject/TEST_AndroidAIR/src/ANESampleTest.as:198]
    at ANESampleTest/onAddedToStage()[/Users/stevewarren/Clients/Speakaboos/git_repositories/ANESampleProject/TEST_AndroidAIR/src/ANESampleTest.as:131]
    at runtime::ContentPlayer/loadInitialContent()
    at runtime::ContentPlayer/playRawContent()
    at runtime::ContentPlayer/playContent()
    at runtime::AppRunner/run()
    at AppEntryCommon/run()
    at global/runtime::AndroidMobileDeviceAppEntry()
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top