AIR 2.0 NativeProcess is not supported problem
I have built a application that use a nativeProcess to open exe.
The application into Flex Builder 3 run whitout errors.
Then the problem come when I export the aplicaction AIR in .air and install the applicaction in the developer pc or other pc.
When I push the button to open the 开发者_JS百科.exe, appear the message "Native Process is not supported".
The code in the main.mxml that I use:
if (NativeProcess.isSupported)
{
var file:File = new File("app:/config/AbrirAplicacion.exe");
var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
nativeProcessStartupInfo.executable = file;
process = new NativeProcess();
process.start(nativeProcessStartupInfo);
process.standardInput.writeUTFBytes(textReceived.text+"\n");
process.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, onOutputData);
process.addEventListener(ProgressEvent.STANDARD_INPUT_PROGRESS, inputProgressListener);
}
else
{
textReceived.text = "NativeProcess not supported.";
}
Any ideas of what I'm doing wrong?
NativeProcess is only available when applications are compiled to native binaries, not .air installers.
You have to set the supportedProfiles-tag to 'extendedDesktop' in order to work with Native Process.
Put / uncomment this line below in your app.xml:
<supportedProfiles>extendedDesktop</supportedProfiles>
NativeProcess can be compiled with Air2 it's just very tricky. The problem is that you have to COMPLETLEY overlay your Flex SDK and the new Air2. Surprisingly, according to this link, you cannot do it through the finder and should do it through the terminal. In Mac:
- Download the SDK from Air SDK and put it in folder 1.
- Make a copy of your flex SDK and put it on folder 2 (in the flex Builder sdks folder)
- Write
ditto -V folder1 folder2
in the terminal to overlay them.
Now go to your project's preferences and select the folder2 as sdk (now it's overlay with folder1).
Also, you will probably need to change the description to:
http://ns.adobe.com/air/application/2.0
There is very good description on Installing the Adobe AIR 2 SDK in Eclipse (check part 3).
Hope that helps.
Solved by
Export with native signed not AIR sign
精彩评论