Skip to main content
Oldes
Inspiring
February 23, 2017
Question

AIR25 - dx tool failed

  • February 23, 2017
  • 19 replies
  • 13443 views

Hi,

does anybody else have a problem to package android apk-captive-runtime target with AIR25?

On some Window's machines (both 32 and 64 bit) we have nothing telling dx tool failed error while evaluating building command from command line. On the same machine using older AIR it is working fine.

The command and output looks like:

c:\dev\S3-Build>java -jar ..\AIR-Win-SDK\lib\adt.jar -package -target apk-captive-runtime -storetype pkcs12 -keystore ./cert/S3.p12 Build\S3.apk  android.xml Data/* -extdir ane/

dx tool failed:

Build failed!

Is there some special requirement for AIR25?

Thanks,

David

This topic has been closed for replies.

19 replies

Participant
February 27, 2019

Problem solved here after an edit of "adt.bat" inside of "bin" directory of sdk.

Simply change "@java" to the jre64 install dir, as showed in the following lines

original
@java -jar "%~dp0\..\lib\adt.jar" %*

changed
C:\DEV\Java\jre8-64\bin\java.exe -jar "%~dp0\..\lib\adt.jar" %*

lucasp35885850
Participating Frequently
September 12, 2019
Hello, I have the same problem generating apk on air 25+ SDK versions in Flash Professional CS6. I have done these procedures and not yet solved. Air SDK 24- I can generate the apk. Any more tips?
Known Participant
October 28, 2018

java version "1.8.0_181"

our java_home set to this.

i think current air sdk doest not support java8 featured jars

Known Participant
October 5, 2018

This was screenshot I took back on 5/7/2017 right using AIRSDK v25.
I was able to sign and package the app without problem.

If you have dx tool failed during packaging the only working solution is by set explicitly JAVA_HOME to JDK8 BEFORE you sign your app.
That simple.

WHy??
Because adt.jar and sooo many .jars outthere still INCOMPATIBLE with JDK 9+ , in which we know JDK 9 and above has radical change on its own architecture.

SO if you have multiple Java installation, please explicitly SET  JAVA_HOME to Java 8 first

Known Participant
September 27, 2018

problem still persist even with latest air sdk 31

using jdk 1.8.0_181 64bit(tried other version and jre)

android build tool 28 also min sdk version is 27

dx tool failed:WARNING in com.mapbox.mapboxsdk.log.LoggerDefinition.log:(ILjava/lang/String;Ljava
/lang/String;)V: defining a static interface method requires --min-sdk-version >= 24 (currently 13) for
interface methods: com.mapbox.mapboxsdk.log.LoggerDefinition.log:(ILjava/lang/String;Ljava
/lang/String;)

Uncaught translation error: com.android.dx.cf.code.SimException: ERROR in
com.mapbox.mapboxsdk.http.NativeHttpRequest.executeLocalRequest:(Ljava/lang/String;)V:
invalid opcode ba - invokedynamic requires --min-sdk-version >= 26 (currently 13)

Uncaught translation error: com.android.dx.cf.code.SimException: ERROR in
com.mapbox.mapboxsdk.log.Logger.log:(ILjava/lang/String;Ljava/lang/String;)V:
invoking a static interface method com.mapbox.mapboxsdk.log.LoggerDefinition.log:(ILjava/lang
/String;Ljava/lang/String;)V strictly requires --min-sdk-version >= 24 (blocked at current API level 13)

Uncaught translation error: com.android.dx.cf.code.SimException: ERROR in
com.mapbox.mapboxsdk.maps.MapView.initialiseDrawingSurface:(Lcom/mapbox/mapboxsdk
/maps/MapboxMapOptions;)V:
invalid opcode ba - invokedynamic requires --min-sdk-version >= 26 (currently 13)
3 errors; aborting

antog10602981
Participant
August 4, 2017

I had that problem and it's SOLVED NOW. I use windows 10 64bit, and FlashDevelop with Starling.

I just updated AIR and Java 64 (uninstalled all the JAVA programs first, which probably were 32-bit). And it worked.

P.S. I also changed my project's XML to air 26 and changed the location in my project's SetupSDK.bat to AIR 26.

P.P.S: After uninstalling all JAVA programs I used the link below to install JRE and then JDK.

http://www.oracle.com/technetwork/java/javase/downloads/index.html

Known Participant
July 30, 2017

This problem brought us too many headaches.

Is there any news?

Switching to the 64 bit Java is a very bad way for us, as we use 32 bit FlashDevelop together with 32 bit plugins. If we switch to 64 bit java, we would be forced to switch to 64 bit FlashDevelop.

Participant
July 27, 2017

I have encountered this problem, I was replaced by 64-bit java can solve this problem, you need to change the system environment variables into 64-bit java, I hope you help!

Inspiring
June 7, 2017

Looks like AIR 25 has brought this issue up again.

I solved it by switching from 32-bit jdk 1.7.0_79 to 64-bit jdk 1.8.0_91 (by setting the PATH var in my batch file where I run ADT).

Sounds like 1.8.0_121 may also be incompatible with AIR 25, according to this thread discussing the same problem. May have something to do with the switchover to 64 bit certificates.

Participating Frequently
July 25, 2017

AIR 26, same problem. Java version: 1.7.0_80

Participating Frequently
July 25, 2017

updated java to the latest 1.8 and now it works

Participant
May 24, 2017

I had this same issue.

Fixed it with the following configuration:

- AIR 25

- Project Properties: AIR Mobile vs 21

- global Java version 1.6 32bits (for FlashDevelop)

- (the MAGIC) edited the adt.bat file to set the java path to a 1.8 64 bits version like this:

     ::@java -jar "%~dp0\..\lib\adt.jar" %*

     "C:\Program Files\Java\jre1.8.0_131\bin\java.exe" -jar "%~dp0\..\lib\adt.jar" %*

Worked for me.

Hope this will help you.

Known Participant
July 30, 2017

v1v0c4, you are a genius!!!!

I tried a million things. Finally found your post and it worked.

Had to make some changes. I used:

  • jre1.8.0_111 32 bit - For FlashDevelop - Environment variable JAVA_HOME C:\Progra~2\Java\jre1.8.0_111
  • jre1.8.0_111 64 bit - For publishing to devices - Inserted the script in adt.bat (AIRSDK26/bin/adt.bat) as you have suggested: "path_to_64bit_java\bin\java.exe" -jar "%~dp0\..\lib\adt.jar" %*

Both problems (dx and certificate) were solved.

I am using AIR 26 on Win 10.

Thank you a lot!!!! You ended my nightmare!

Participant
May 22, 2017

Was having the same problem which i've managed to resolve by changing my 32 bit java environment to:

java version "1.8.0_131"

Java(TM) SE Runtime Environment (build 1.8.0_131-b11)

Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

i.e. 64 bit JDK

Also, i'm using AIR SDK v25.