Build ActionScript Native Extension - actionscript-3

I'am trying to build an ANE,
this is my extension.xml
<extension xmlns="http://ns.adobe.com/air/extension/3.1">
<id>com.skunk.nativelibrary</id>
<versionNumber>1</versionNumber>
<platforms>
<platform name="Android-ARM">
<applicationDeployment>
<nativeLibrary>boot.jar</nativeLibrary>
<initializer>com.skunk.startonboot.NativeLibraryExtension</initializer>
<finalizer>com.skunk.startonboot.NativeLibraryExtension</finalizer>
</applicationDeployment>
</platform>
</platforms>
</extension>
I call it this way on the Flex Library Project :
context = ExtensionContext.createExtensionContext("com.skunkkk.nativelibrary", null);
I have a folder containing those doc :
Boot.jar ( the native part )
The extension.xml file
The SWC from the Flex Library Project
The SWF extarcted from the last file
The .P12 keyFile
Finally I run this on the cmd :
adt -package -storetype pkcs12 -storepass [keyPassWord] -keystore skunkkk.p12 -tsa none -target ane StartOnBoot.ane extension.xml -swc SkunKNativeLibrary.swc -platform Android-ARM library.swf boot.jar
What could possibly be wrong ? Thank you !
I followed this tutorial just to see, created an ANE with his source code, My application crashes when using it ...
I don't know if I need a compatibility configuration for the ANE, anyway, I am using Adobe Flash Builder 4.6, Flex SDK 4.6.0, AIR 3.1, Eclipse Kepler and testing on Android 4.1.2

I was running a wrong command, this is how it worked :
adt -package -storetype pkcs12 -keystore FILE_KEY_NAME.p12 -storepass FILE_KEY_PASSWORD -target ane LIBRARY_NAME.ane extension.xml -swc SWC_FILE_NAME.swc -platform Android-ARM -C android_lib_dir .
Of course, I have the library.swf and NATIVEPROJECT.jar inside the directory android_lib_dir
May be someone will face the same problem,

Related

AndroidStudio Exception when starting android in a libgdx project

I get an exception when running the android gradle task in Android Studio 3.0.1. My project is build with libgdx. My desktop gradle task runs just perfect.
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':android:validateSigningDebug'.
where the root cause is
Caused by: java.lang.SecurityException: class "org.bouncycastle.jcajce.provider.symmetric.IDEA$Mappings"'s signer information does not match signer information of other classes in the same package
I have absoluty no idea how to fix this.
Mar Dev gave the right hint for me. I did:
cd ~/.android
keytool -genkey -v -keystore debug.keystore -alias androiddebugkey -keyalg RSA -keysize 2048 -validity 10000
keytool -importkeystore -srckeystore debug.keystore -destkeystore debug.keystore -deststoretype pkcs12
Then in AndroidStudio I followed the accepted answer of Where is debug.keystore in Android Studio

FlashBuildeC native extension 'InputMethodContext' required by the application was not found

I am working on an existing Flex project and I am using FlashBuilder. I would like to use FlashBuilderC and fb.exportReleaseBuild ant task to schedule nightly builds.
It seems I have a problem with native extensions.
fb.exportReleaseBuild] com.adobe.air.InvalidInputException: An implementation f
or native extension 'InputMethodContext' required by the application was not fou
nd for the target platform
Using Flash Builder GUI, I can successfully build and package the project
This is my build.xml
<?xml version="1.0"?>
<project default="main">
<target name="main">
<fb.exportReleaseBuild project="myproject" />
</target>
</project>
And this is the script I use
set WORKSPACE=path_to_my_workspace
REM works with either FlashBuilderC.exe or eclipsec.exe
"C:\Program Files\Adobe\Adobe Flash Builder 4.7 (64 Bit)\FlashBuilderC.exe" ^
--launcher.suppressErrors ^
-noSplash ^
-configuration C:\flashbuilderconf ^
-application org.eclipse.ant.core.antRunner ^
-data "%WORKSPACE%" ^
-file "%cd%\build.xml"
Am I missing anything?

Build fails when ZipAligning

I have just installed Xamarin along with the plugin for Visual studio 2013 professional.
Now I have a problem when I open an Android project and I build it, it throws an error.
System.Exception: Build started.
C:\Program Files\Java\jdk1.6.0_39\\bin\jarsigner.exe -keystore "C:\Users\Asad Shafique\AppData\Local\Xamarin\Mono for Android\debug.keystore" -storepass android -keypass android -digestalg SHA1 -sigalg md5withRSA -signedjar bin\Debug\App6.App6-Signed-Unaligned.apk obj\Debug\android\bin\App6.App6.apk androiddebugkey
The specified task executable location "C:\Users\Asad Shafique\AppData\Local\Android\android-sdk\\tools\zipalign.exe" is invalid.
Build FAILED.
What would the problem be?
Go to your Android SDK folder C:\Users\Asad Shafique\AppData\Local\Android\android-sdk\build-tools\19.1.0 and copy "zipalign.exe" to C:\Users\Asad Shafique\AppData\Local\Android\android-sdk\tools.
Google has changed their paths in the latest SDK.
Xamarin forum discussion

Native Context not available using Leapmotion AS3 ANE file

I´m getting this error while trying to compile a Flashdevelop AIR project:
Native Context not available. The Config class is only available in Adobe AIR.
My setup:
Using Starling.
Using the ANE file from https://github.com/logotype/LeapMotionAS3
Using Flex SDK 4.6.0/AIR 3.8 in Flashdevelop 4.4.4 RTM
Extended Desktop profile is on.
The error fires up when I try to use the controller.config() or screen.* as in:
if(leap.config().setFloat("Gesture.Swipe.MinLength", 200.0) && leap.config().setFloat("Gesture.Swipe.MinVelocity", 500)) leap.config().save();
My onConnect();
private function alConectar(event:LeapEvent):void{
trace("conectado");
leap.enableGesture(Gesture.TYPE_SWIPE);
leap.enableGesture(Gesture.TYPE_SCREEN_TAP);
if(leap.config().setFloat("Gesture.Swipe.MinLength", 200.0) && leap.config().setFloat("Gesture.Swipe.MinVelocity", 500)) leap.config().save();
if(leap.config().setFloat("Gesture.ScreenTap.MinForwardVelocity", 30.0) && leap.config().setFloat("Gesture.ScreenTap.HistorySeconds", .5) && leap.config().setFloat("Gesture.ScreenTap.MinDistance", 1.0)) leap.config().save();
//etc...
}
The full output:
Running process: C:\Program Files\FlashDevelop\Tools\fdbuild\fdbuild.exe "C:\Users\CASA\Documents\00_INTERACTIVE\LEAP\Leap_AirAS3Proj\Leap_AirAS3Proj.as3proj" -ipc 8b4c615f-60f6-46ac-aec0-093781073835 -version "3.8.0" -compiler "C:\Program Files\FlashDevelop\Tools\ascsdk" -library "C:\Program Files\FlashDevelop\Library"
Building Leap_AirAS3Proj
mxmlc-cli -load-config="C:\Program Files\FlashDevelop\Tools\ascsdk/frameworks/air-config.xml" -load-config+=obj\Leap_AirAS3ProjConfig.xml -debug=true -inline=true +configname=air -swf-version=21 -o obj\Leap_AirAS3Proj635190875306772137
Running java as: java.exe
Loading configuration: C:\Program Files\FlashDevelop\Tools\ascsdk\frameworks\air-config.xml
Loading configuration: C:\Users\CASA\Documents\00_INTERACTIVE\LEAP\Leap_AirAS3Proj\obj\Leap_AirAS3ProjConfig.xml
206311 bytes written to C:\Users\CASA\Documents\00_INTERACTIVE\LEAP\Leap_AirAS3Proj\obj\Leap_AirAS3Proj635190875306772137 in 6.156 seconds
Build succeeded
Done(0)
[Starting debug session with FDB]
[Starling] Initialization complete.
[Starling] Display Driver: DirectX9 (Baseline Constrained)
init
conectado
[Fault] exception, information=Error: Native Context not available. The Config class is only available in Adobe AIR.
Already change the bat/SetupSDK to: set FLEX_SDK=C:\Program Files\FlashDevelop\Tools\ascsdk to reflect the SDK (Thanks to Philippe from Flashdevelop).
Any help is welcome.
Regards!

ADT Captive Runtime Package Command Line Error

I'm attempting (unsuccessfully) to package a captive runtime of AIR 3.3 application for Windows 7 using the command prompt.
The arguments passed to ADT are correct, as i do not receive errors and i'm prompted for the certificate password:
C:\Users\Geoffrey Mattie>"C:\Program Files (x86)\FlashDevelop\Tools\flexsdk\bin\
adt.bat" -package -keystore "G:\Desktop\AIRCert.p12" -storetype pkcs12 -target b
undle "G:\Desktop\Off Air" "G:\Developer\OffAir\application.xml" -C "G:\Deve
loper\OffAir\bin\OffAir.swf" -C "G:\Developer\OffAir\assets\offAirIcon.png"
password:
However, after entering the password i receive this:
unexpected failure: inputs not set
java.lang.IllegalStateException: inputs not set
at com.adobe.air.ApplicationPackager.createPackage(ApplicationPackager.j
ava:61)
at com.adobe.air.nai.NativePackager.createPackage(NativePackager.java:96
)
at com.adobe.air.ADT.parseArgsAndGo(ADT.java:564)
at com.adobe.air.ADT.run(ADT.java:418)
at com.adobe.air.ADT.main(ADT.java:468)
C:\Users\Geoffrey Mattie>
Could this be happening because my application files are located on the G drive while ADT and Java are on the C drive? Any ideas?
I think you need to specify the name of your .exe file. Instead of:
-target bundle "G:\Desktop\Off Air"
It should probably be:
-target bundle "G:\Desktop\Off Air\MyApp.exe"
Or:
_target bundle "G:\Desktop\Off Air\MyApp.app"
It appears that there was a problem with my manual merging of the AIR 3.4 and Flex 4.6 SDKs. Using the pre-merged version on Adobe's Gaming website solves the issue.