I'm using Adobe Flash Professional CS5.5 with ANE Distriqt Compass, I've created a simple .fla project and written a few lines of AS3 script. The compilation was successful, but when I executed the .swf file on my PC, at the beginning it always says
"The native extension context could not be created"
I thought the problem is caused by my PC's lack of magnetometer, but when I packaged my code into a .apk
file and installed it on my Android device, it said the same thing. After checking through the code, I found out that Compass.init
never executes successfully.
Here is my project, can someone tell me what causes the problem?
I tried to...
Extract the file com.distriqt.Compass.ane
as .zip file.
Then linked the file distriqt.extension.compass.default.swc
under META-INF/ANE/default
directory.
I also tried the solution from this link, but that doesn't work either. I've searched through the Google inside-out, but it seems to be have no solution.
That error indicates you aren't correctly packaging the ANE with your application.
With CS5.5 you'll need to package your application from the command line in order to correctly package ANEs. CS5.5 didn't include the ability to package applications using ANEs.
Firstly make sure you have added the extension ID to your application descriptor:
<extensions>
<extension>com.distriqt.Compass</extension>
</extensions>
To add the extension:
Library Path
tab in the Advanced ActionScript 3.0 Settings dialog boxNext you’ll need to open up a command line in the directory of your built application. The directory should contain:
myApp.swf
myApp-app.xml
extensionsDir
in the following)The details on this command is dependent on the application you are developing and the platform you are targeting. You should review the documentation at the following url to determine the details of what the command should contain for your environment.
http://help.adobe.com/en_US/air/build/WS597e5dadb9cc1e0253f7d2fc1311b491071-8000.html
For example the following command will create an APK for Android:
adt -package
-target apk
-storetype pkcs12 -keystore YOUR_SIGNING_KEY.p12
myApp.apk
myApp-app.xml
myApp.swf icons
-extdir extensionsDir
For more information see the tutorial here: https://airnativeextensions.com/knowledgebase/tutorial/1