Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dx tool failed (com.android.dx.cf.code.SimException) unable to build ane with java8 #48

Closed
Xgamefactory opened this issue Oct 4, 2018 · 7 comments

Comments

@Xgamefactory
Copy link

Xgamefactory commented Oct 4, 2018

we are getting dx tool failed error when compiling apk with ane that based on mapbox android sdk with java 1.8 compability.

We are successfully generating ane but unable to build apk.

using jdk 1.8.0_181 64bit(tried other version and jre)
android build tool 28 also min sdk version is 27
adobe air windows sdk 31.0.96 (latest)

also tried replacing old adobe air dx.jar as described in another adobe bugtrack https://tracker.adobe.com/#/view/AIR-4198726 and issue posted here #44

tried all dx.jars including api28 but result is same.

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

We will appreciate if anyone have temporary workaround.

Please vote here: https://tracker.adobe.com/#/view/AIR-4198743

@Xgamefactory
Copy link
Author

Xgamefactory commented Oct 29, 2018

in android studio solutions is to add java source and target properties to gradle like.

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
} 

we got jdk8 installed and set path

C:\Users\user>java -version
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)

Unfortunately adobe air sdk does not have such option. We tried building apk with ant script setting
java source and target properties to 1.8 but still get dx tool failed.

another weird think is dx tool error prints current sdk as 13

but in manifest.xml
<uses-sdk android:minSdkVersion="15" android:targetSdkVersion="28"/>

found similar solutions but did not find how to implement dexoptions for adobe air apk package.

javafxports/javafxmobile-plugin#50 (comment)

Does anyone faced this issue and have a workaround ? i see many ane developers here if you got solutions please don't be envious and share :)

@Xgamefactory
Copy link
Author

we have found solution but cannot rebuild adt.jar inside flex sdk without source codes.

@laokinsham
Copy link

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" %*

@tuarua
Copy link

tuarua commented Jul 4, 2019

AIR33 is now built against Java8

@ajwfrost
Copy link
Collaborator

Issue was caused by how the ADT application was calling Android's AAPT application, fixed in AIR SDK 33.0.0.175 (though the workaround from 27 Feb 2019 above looks useful to anyone on older versions..)

@itlancer
Copy link

I still get such errors with AIR 33.0.1.220 if I try to use ANE with lambda expressions. ANE compiled with AIR 33.0.1.220, java 1.8 compability.
adt.bat patch doesn't help for me - the same errors.

@itlancer
Copy link

For me now it works fine with AIR 33.0.2.281 when uses Java 8 features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants