(Solved) [AS3] Fails to compile apk

So im making first tries to see a simple image on android apk using the AIR Mobile AS3 App in FlashDevelop.

The question is mainly, why when using the PackageApp.bat and [1] for normal apk it gives a commonly seen error

Packaging: dist\TestAS3.apk
using certificate: cert\TestAS3.p12…

dx tool failed:

APK setup creation FAILED.


  • verify AIR SDK target version in application.xml

So I have my certificate , I use Flex SDK + AIR SDK 4.6.0. + 32.0.0 and paths are set correctly to display the image at all.

Tried: Replacing 28.0 with 32.0 even though it still asks for it, no success
<application xmlns="http://ns.adobe.com/air/application/32.0">

Project - Air App Properties warns that I don’t use 28.0 version. Either way, ID field should be like air.TestAS3 and I need to use the same in the XML ? Well still doesn’t change anything

Looks like your swf-version is set to 26. Try setting it to 43 for AIR 32 and see if that helps.

Open the project in FlashDevelop and go to Project->Properties->Compiler Options, expand “Advance Compiler Options” near the top. Look for “-swf-version=26” and set it to “-swf-version=43”. Recompile the SWF and then try to rebuild the APK.

On latest FD it has Compiler Options, Additional Comp Options then I add the above for swf as a string.

I even followed instrucs here:

And adob versions here:

Yet I still get the error. At other place they advised the error was because an image is not displaying correctly (this is a simple project to display 1 image)

Here is an updated version

Hello, this sounds like a java version issue, look here : https://forums.adobe.com/thread/2281743

I remember getting this error and solving it with a different JRE

^ Thanks… I thought Adobe detects you have x64 OS obviously but kept giving me Java where architexture is x86 only, now I downloaded the manual install that now shows architecture as x86_64

It gave some error not finding something but the apk was built.

Except… the project I posted above shows as pure white on test. Is it because I had one error were it would not refer the image in my code
It still displays the image the 1st time, then again gives the same error the next time I F5 to test, here is the full error,`

ReferenceError: Error #1065: Variable com.mee.ptest::PicTest_cTestPic is not defined. at com.mee.ptest::PicTest$cinit() at global$init() at Main/show_Pic() at Main()

So when I test using the ADB it shows the image in this simple project but next time I F5 it will give the error, I wonder if im seeing white screen on the device because of this or because of the APK build error (even though it built)

Message when building the app:

Packaging: dist\TestAS3.apk
using certificate: cert\TestAS3.p12…

NOTE: The application has been packaged with a captive runtime.

‘adb’ is not recognized as an internal or external command,
operable program or batch file.

Installing dist\TestAS3.apk on the device…

‘adb’ is not recognized as an internal or external command,
operable program or batch file.

Installing the app on the device failed
Press any key to continue . . .

(at least I got apk file this time)

I think it says that installing (unpacking) the apk fails on the adb or desktop, well I dont care, I test it directly on the mobile device. But it displays white instead when started from my phone, thus I wonder if the Pic error causes the image not to display on apk

similar reports, not because the var is really not defined, “Cleaning the project seems to solve this issue - but it has to be done each and every run / compile”… " have to swithc between release and debug" - exactly my case

here is my code

Solved by installing also and changing to 1.6 JRE for java.home= in jvm.config. No more ‘Variable not defined’ when F5 in Debug/Release several times.

Also solved to display the image when installing APK on device, well it’s cut off the screen but that’s expected… now to the ‘pinch to zoom in/out and display properly questions’