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

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?

Related

Can a jlinked runtime be deployed with javapackager?

The instructions to javapackager just above Example 2-1 in the Java SE Deployment Guide/Self-Contained Application Packaging state that a jar file is required in the -deploy command.
If I use a modular jar, I get this error message:
Exception: java.lang.Exception: Error: Modules are not allowed in srcfiles: [dist\tcdmod.jar].
If I use the equivalent non-modular jar, the resulting package includes the complete runtime. But I want to use the reduced runtime I made with jlink that is in the /dist folder.
Can the javapackager command deploy with a jlink-generated runtime?
How?
The section titled "Customization of the JRE" makes no mention of the javapackager command.
The following section "Packaging for Modular Applications" has a following line:
Use the Java Packager tool to package modular applications as well as non-modular applications.
Is the Java Packager tool distinct from javapackager? There are no examples using javapackager in this section.
Here is the javapacker command that I used:
javapackager -deploy -native -outdir packages -outfile ToneCircleDrone -srcdir dist -srcfiles tcdplain.jar -appclass com.adonax.tanpura.TCDLaunch -name "ToneCircleDrone" -title "ToneCircleDrone test"
The instructions in the javapackager documentation make no mention of the scenario where a jlink runtime is used. There is a Bundler argument -Bruntime but it is only used to point to an installed runtime other than the system default, AFAIK.
The javapackager provided with JDK 9 and up uses jlink to generate the jre image:
For self-contained applications, the Java Packager for JDK 9 packages
applications with a JDK 9 runtime image generated by the jlink tool. To
package a JDK 8 or JDK 7 JRE with your application, use the JDK 8 Java
Packager.
https://docs.oracle.com/javase/9/tools/javapackager.htm#JSWOR719
You can even pass arguments to jlink using -BjlinkOptions=<options>
Additionally, -Bruntime is only valid for packages deployed using -deploy -native jnlp
For compiling a modular application, instead of -srcdir, use --module-path <dir>, and then specify the main module using -m <module name>.
EDIT: While there is no documentation on -BjlinkOptions, it is present in the javapackager source
jdk.packager/jdk.packager.internal.legacy.JLinkBundlerHelper
https://github.com/teamfx/openjfx-10-dev-rt/blob/bf971fe212e9bd14b164e4c1058bc307734e11b1/modules/jdk.packager/src/main/java/jdk/packager/internal/legacy/JLinkBundlerHelper.java#L96
Example Usage: -BjlinkOptions=compress=2 will make javapackager run jlink with the --compress=2 flag, generating the JRE image with Zip Level compression.
Aditionally, running javapackager with the flag -Bverbose=true will show you exactly which arguments are being passed to jlink with a line in the output something like this:
userArguments = {strip-debug=1 compress=2}

Dependency on .Net Native

I got the following certification error when submitting to the app store.
[My App Name] takes a dependency on Microsoft .Net Native Runtime Package 1.x framework but is missing the framework dependency declaration in the manifest.
[My App Name] takes a dependency on Microsoft .Net Native Framework Package 1.x framework but is missing the framework dependency declaration in the manifest.
How does one provide this dependency in the appxmanifest? What's the syntax?
I have this currently:
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
</Dependencies>
I had the same error, and I found that ticking "Optimise Code" in build options made it go away.
I find that with Microsoft poke-and see is the most reliable technique.
Just had a similar issue. Try adding a PackageDependency line to the Package.appmanifest:
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
<PackageDependency Name="Microsoft.NET.Native.Runtime.1.4" MinVersion="1.4.24201.0" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" />
</Dependencies>
See: UWP App Package created with Visual Studio 2015 Update 3 won't install on phone

Unable to add include ANE File in ANT Script

I wanted to create an ANT Script to create build in one click for my Flex Mobile Project.
My app using some native extension file (.ane file). When I tried to run the ANT script it saying -
An implementation for native extension 'com.example.mobile.extensions.NativeFeature' required by the application was not found for the target platform
I'm using the following code to include ane file in ANT Script.
<compiler.external-library-path dir="${basedir}/ane" append="true">
<include name="**/*.ane"/>
</compiler.external-library-path>
Also added the same extensionId in myApp-app.xml file which I used in my extension.xml file.
Solved this problem. Basically I need to add -extdr argument in ADT command. By adding -extdir ${basedir}/ane in ADT command I am able to resolve the problem. Added sample code below.
<target name="package.android" >
<echo message="Packaging for Android"/>
<exec executable="${ADT}" dir="${build.dir}/android">
<arg line="-package
-target apk
-storetype ${build.storetype}
-keystore ${android.cert}
-storepass ${android.cert.password}
${app.name}
${app.name}-app.xml
${app.name}.swf
-extdir ${basedir}/ane
"/>
</exec>
</target>

Error: unable to open AIRSDK/frameworks/libs/player/11.1/playerglobal.swc

I get the following error intermittently when compiling a swc using compc:
[exec] Using AIR SDK: /Applications/Adobe Flash Builder 4.7/eclipse/plugins/com.adobe.flash.compiler_4.7.0.349722/AIRSDK
[exec] Loading configuration: /Applications/Adobe Flash Builder 4.7/eclipse/plugins/com.adobe.flash.compiler_4.7.0.349722/AIRSDK/frameworks/flex-config.xml
[exec]
[exec] /Applications/Adobe Flash Builder 4.7/eclipse/plugins/com.adobe.flash.compiler_4.7.0.349722/AIRSDK/frameworks/flex-config.xml:47
[exec] Error: unable to open '/Applications/Adobe Flash Builder 4.7/eclipse/plugins/com.adobe.flash.compiler_4.7.0.349722/AIRSDK/frameworks/libs/player/11.1/playerglobal.swc'.
[exec] /Applications/Adobe Flash Builder 4.7/eclipse/plugins/com.adobe.flash.compiler_4.7.0.349722/AIRSDK/frameworks/flex-config.xml (line: 47)
[exec] </external-library-path>
[exec]
[exec]
I can't seem to find any reason why this would happen. The directory /Applications/Adobe Flash Builder 4.7/eclipse/plugins/com.adobe.flash.compiler_4.7.0.349722/AIRSDK is setup as AIR SDK 3.7 and as I said the error is intermittent, if I keep building it will eventually go away.
Another thing that seems weird is this:
[exec] Loading configuration: /Applications/Adobe Flash Builder 4.7/eclipse/plugins/com.adobe.flash.compiler_4.7.0.349722/AIRSDK/frameworks/flex-config.xml
So I am baffled why it would ever attempt to look for 11.1/playerglobal.swc. As it works sometimes, it seems like everything is setup correctly but I haven't been able to figure out what causes the script to wig out.
This step is from an ant script. The ant script is as follows:
<exec executable="${COMPC}" failonerror="true">
<env key="FLEX_HOME" value="${FLEX_HOME}"/>
<env key="AIR_SDK_HOME" value="${AIR_SDK_HOME}"/>
<arg line="-source-path ${SRC_DIR}"/>
<arg line="-output ${BIN_DIR}/${OUTPUT_FILENAME}"/>
<arg line="-swf-version ${SWF_VERSION}"/>
<arg line="-external-library-path+="${FLEX_HOME}/frameworks/libs/air/airglobal.swc""/>
<arg line="-define+=CONFIG::LOGLEVEL,4"/>
<arg line="--keep-as3-metadata+=TypeHint,EditorData,Embed,Inject,PostInject"/>
<arg line="-inline"/>
<arg line="-include-classes ${classes}"/>
</exec>
-swf-version is being passed in as 20, I have an echo right before this task executes to verify it doesn't change.
The AIR_SDK_HOME and FLEX_HOME values are being set as such:
<property name="FLEX_HOME" value="/Applications/Adobe Flash Builder 4.7/eclipse/plugins/com.adobe.flash.compiler_4.7.0.349722/AIRSDK" />
<property name="AIR_SDK_HOME" value="${FLEX_HOME}" />
ADDITIONAL NOTES:
Usually when this error happens it continues to happen until the terminal window is closed and restarted.
Another thing I am starting to notice is that it happens more frequently (or perhaps only happens) immediately after a failed build within the same terminal window.
Any help or advice is appreciated! Thanks!
I resolved this problem such a way:
- manualy create folder: AIRSDK_HOME\frameworks\libs\player\11.1\
- copy actual version 'playerglobal.swc' ( I have from AIRSDK_HOME\frameworks\libs\player\15.0\ to AIRSDK_HOME\frameworks\libs\player\11.1\ )

Build ActionScript Native Extension

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,