-
Notifications
You must be signed in to change notification settings - Fork 10
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
Unable to run java: com.adobe.air.ADTException: gradle tool failed #3629
Comments
I have the same problem. Can not create any AAB Build. The JAVSA_HOME is set and the ANDROID SDK too at the config file.
|
Can you try to use JDK 17 instead of newer version ? @apofis1969 , do you use ANE ?
|
@Policy56 I am using JDK 17, I have ANEs. All the latest versions. |
@apofis1969 , can you try to downgrade your ANE version or distriqt to not use v3.0.0 . (issue distriqt/ANE-AndroidSupport#36) |
@Policy56 I did the downgrade. Still the same bug. Frustrating. |
Can you try to clean your gradle folder ? On Windows:
On Mac or UNIX:
|
@Policy56 the ./gradlew did not work. I deleted the cache of the hidden .gradle folder. Opened Android Studio again and then I had to install gradle again. Tomorrow I will test the build on my Android phone. |
Hi There seem to be a couple of different issues within this thread...
@Gis234 for the first one - this has been seen before and in one case appeared to be caused by a JAR file that had some class file information from Java 21, even though the class files within the JAR were themselves all using a Java 11 or 17 version. If you are still seeing this, would you be able to confirm what ANEs you're using (and even better if it's possible to remove any of them in order to isolate one that may be at fault?). For example do you use anything from BouncyCastle? @apofis1969 that issue is a new one to me but cleaning up .gradle is a good idea (it should just re-create it next time it's used). From the above comment I wonder whether the build is actually working now (i.e. you have a package to test so the building part presumably succeeded)? FYI we have been trying to reproduce these, but then encountered a new/different issue! Regarding duplicate Kotlin classes.. which we eventually solved by editing the app's build.gradle file using the suggestion here: https://stackoverflow.com/a/75315276 i.e. adding to the end:
(building via the ADT The Gradle-based building does seem a little sensitive to the various combinations of Java, Gradle, Android Gradle Plugin, and the Android compile SDK and build-tools versions.... |
Hi @ajwfrost - it does not work with the new ANEs. I made a build with the ANEs which I used in June 2024. So the mistake is with the ANEs or with some of them. |
@ajwfrost - It is working now with the newest ANEs. I do not understand why suddenly. I will try it tomorrow again. This is very strange. |
@apofis1969 thanks - just to check: "it does not work" meaning, it doesn't build an APK/AAB file, but instead fails with the Ah, just seen your update. "This is very strange" = fast becoming our team's catchphrase... If you find the issue again, I would suggest building using the thanks |
Hi, |
Hi @Gis234
The log shows that it's updating to use 8.1.1 as the Android Gradle Plug-in version, and is probably using Gradle 8.0. This means that you must use Java versions 17 through 20: Gradle 8 is not supported on Java versions 16 or less, or on version 21 and later. The compatibility is still somewhat unclear, unless anyone can find a better reference! The official compatibility matrix doesn't clarify which of these is a 'minimum' and whether there's a 'maximum', so the Java compatibility doesn't really help unless it's meant to mean that you choose which Gradle version to use based on the Java version that you have (which seems the wrong way round to do things ...!) You can actually change the version of Gradle (and the Android Gradle Plug-in) that AIR/ADT will use, via the application descriptor within the
Hope that helps! |
Here is the java version in Android studio: C:\Program Files\Android\Android Studio\jbr\bin>java.exe -version |
Okay I'm going to try to change the Gradle version, but I wonder, wouldn't it be better to use java 17 or 20 than to change the Gradle version? |
@ajwfrost - I wanted to say, that I could compile an aab build. I also created a new project in Android Studio. Deleted the cache in the .gradle folder on my Mac. Opened the new Android Project again and the missing gradle configurations had been downloaded. I am using Java 17. |
Possibly .. although if your Java installation within Android Studio is set to 21, it implies Android Studio is expecting you to use a later Gradle version... which may mean we should be trying to detect this and update the Gradle versions appropriately. If you were to do this in Android Studio, I would expect a little pop-up to appear asking you to upgrade the Gradle/AGP versions... @apofis1969 definitely strange ..! and possibly something hidden to do with caches and compatibilities perhaps. Fingers crossed for it working tomorrow still :-) |
Thank you Andrew for this information. I will keep you informed of developments |
Well, I pasted the 2 lines that you gave me to place in the application description file in the tag. The new error message is this:
I'm going to change 8.4 to 8.7 in the lines.
|
It's better for me. The apk file is generated. I upgraded Gradle to 8.9 and removed the line:
in the game descriptor xml file, because I had an error telling me about it. Now I'm going to see if I needed this line. THANKS |
Finally, even by decommenting the line I close |
Thanks 😉 |
@Gis234 If you have updated your extensions lately you need to reconstruct your app descriptor. There have been major changes to the manifest additions required for all our extensions and lines like the one you have referenced are no longer needed. |
Problem:
AIR SDK: 51.1.3.1
Environment: Android
Hello,
For a few days I have been trying to compile my application but I have encountered an error message that I cannot resolve.
I uninstalled, reinstalled and updated Java and Android Studio with no results.
I have the impression that it is a problem with "Gradle" but Gradle JDK is pointed at "C:\Program Files\Android\Android Studio\jbr"
This is an error that happens when I compile an "aab" to a device and it started when I updated to the Adobe air Sdk 50 version.
I removed the only ANE I have (Admob), without success.
In Anroid studio I configure for Andoid 15.0(VanillalceCream) and gradle-8.9 version
The generated log:
*** ADT Logging at 2024/12/31 06:17:48 ***
Called by: C:\Program Files\Adobe\Adobe SDK\AIR 51.1.3.1\lib\adt.jar
ADT 51.1.3.1 called with: -package -target apk-captive-runtime -arch armv8 -storetype PKCS12 -keystore C:/certificats_Android/Igisorofree.p12 -storepass xxxxxx MyGame.apk C:/d dur1/sites/MyGame/Fini/MyGame2_debuging/Myame-app.xml -C C:/d dur1/sites/MyGame/Fini/MyGame2_debuging/ MyGame2free.swf icons/icon_192_3.png icons/icon_144_3.png icons/icon_96_3.png icons/icon_72_3.png icons/icon_36_3.png icons/icon_48_3.png -C C:/d dur1/sites/MyGame/Fini/igisoro2_debuging/ ANEAdMobmaster/com/AdMobIgisoro.as -C C:/d dur1/sites/Myame/Fini/MyGame2_debuging/ array/igisoro/array.as -C C:/d dur1/sites/MyGame/Fini/Myame2_debuging/ com/jeu/commun/billesDansTrou/src -C C:/d dur1/sites/MyGame/Fini/MyGame2_debuging/ com/jeu/commun/Jeu.as -C C:/d dur1/sites/MyGame/Fini/MyGame2_debuging/ com/jeu/niveaux -C C:/d dur1/sites/MyGame/Fini/MyGame_debuging/ com/jeu/MyGame.as -C C:/d dur1/sites/MyGame/Fini/igisoro2_debuging/ com/rs -C C:/d dur1/sites/MyGame/Fini/MyGame2_debuging/ images -C C:/d dur1/sites/MyGame/Fini/MyGame2_debuging/ inclusions -C C:/d dur1/sites/MyGame/Fini/MyGame2_debuging/ mp3 -extdir C:/Users/GODELI1/AppData/Local/Temp/MyGame2free_ANE_Cache/
Overriding request for apk-captive-runtime, instead generating Android App Bundle
Ignoring architecture request for AAB target
Creating device SDK handler - location passed in = C:\Users\Godelieve\AppData\Local\Android\Sdk
NOTE: Multiple Android build-tools folders exist, choosing the latest version (35.0.0) for packaging
Version in APK = 51.1.3.1, version of ADT = 51.1.3.1
Version in APK = 51.1.3.1, version of ADT = 51.1.3.1
Version in APK = 51.1.3.1, version of ADT = 51.1.3.1
Version in APK = 51.1.3.1, version of ADT = 51.1.3.1
NOTE: targets later than Android 33 need Gradle Plugin versions of 8 or more. Adjusting to 8.1.1
Gradle build where ADT is using JRE version 12.0.1
but where Gradle will be using the JDK from C:/Program Files/Android/Android Studio/jbr\bin\java.exe
Gradle build command: C:/Program Files/Android/Android Studio/jbr\bin\java.exe -Xmx1024m -Dorg.gradle.appname=gradlew -Dorg.gradle.jvmargs=-Xmx1024m -Duser.dir="C:\Users\GODELI1\AppData\Local\Temp\a66c0085-9b93-4847-bd47-bd54be495f5d" -cp "C:\Users\GODELI~1\AppData\Local\Temp\a66c0085-9b93-4847-bd47-bd54be495f5d\gradle\wrapper\gradle-wrapper.jar";"C:\Program Files\Adobe\Adobe SDK\AIR 51.1.3.1\lib\android\bin\gradle-cli.jar" org.gradle.wrapper.GradleWrapperMain :app:bundleRelease
..java.base/java.lang.Thread.getStackTrace(Thread.java:1602)
..com.adobe.air.DebugFile.printStack(DebugFile.java)
..com.adobe.air.ADTException.(ADTException.java)
..com.adobe.air.apk.AABOutputStream.buildGradle(AABOutputStream.java)
..com.adobe.air.apk.AABPackager.renameOutput(AABPackager.java)
..com.adobe.air.ApplicationPackager.createPackage(ApplicationPackager.java)
..com.adobe.air.apk.AABPackager.createPackage(AABPackager.java)
..com.adobe.air.ADT.parseArgsAndGo(ADT.java)
..com.adobe.air.ADT.run(ADT.java)
..com.adobe.air.ADT.main(ADT.java)
Stack trace:
Unexpected failure: Unable to run java: com.adobe.air.ADTException: gradle tool failed:
FAILURE: Build failed with an exception.
What went wrong:
Could not open settings generic class cache for settings file 'C:\Users\Godelieve\AppData\Local\Temp\a66c0085-9b93-4847-bd47-bd54be495f5d\settings.gradle' (C:\Users\Godelieve.gradle\caches\8.0\scripts\5y6bqie0ral8doqg354vmfpkh).
BUG! exception in phase 'semantic analysis' in source unit 'BuildScript' Unsupported class file major version 65
Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Get more help at https://help.gradle.org/
BUILD FAILED in 13s
My adt.cfg file:
See release notes: uncomment these lines in order to force your APK to be generated with 64-bit ARM binaries
(needed when using an IDE such as Adobe Animate that currently only provides armv7 and x86 as the options via the UI)
DefaultArch=armv8
OverrideArch=armv8
See release notes and #58
#UncompressedExtensions=emd,tfl,tflite,pb
Default is to prefiix the package with 'air.' - to turn this off, uncomment the below line
#AddAirToAppID=false
If you need to increase the heap available to Java when packaging an Android app, you can use the below setting
when ADT is run from another tool. (If run from the command line, just add -Xmx=2048m or similar to the command
line within the ADT launch script..)
#JavaXmx=2048m
For debugging, set this to 'true' and a file "adt.log" should be generated in your user's home folder
DebugOut=true
To override the creation of an Android APK file, and to instead create an Android App Bundle, the below
flag can be uncommented. Note that the bundle may end up with an "apk" file extension
CreateAndroidAppBundle=true
When creating an Android App Bundle, this flag can be used to output the Android Studio project
files in a subfolder of your build directory (rathe than using a temporary location that gets
cleaned up on exit).
#KeepAndroidStudioOutput=true
For convenience, rather than using "-platformsdk" on the command line, these can be set up here:
AndroidPlatformSDK=C:\Users\Godelieve\AppData\Local\Android\Sdk
#iOSPlatformSDK=path_to_sdk
JAVA_HOME is usually picked up from an environment variable but this can override it:
JAVA_HOME=C:\Program Files\Android\Android Studio\jbr
on macos platorms, use the native codesign task rather than trying to use ADT's internal code:
#UseNativeCodesign=true
NOTE TO WINDOWS USERS: paths should be either in the form "C:\Users\etc", with two backslash characters, or using
forwardslash characters instead such as "C:/Users/etc". If a single backslash is used, the config file is ignored.
Please help
The text was updated successfully, but these errors were encountered: