I wrote this post some time last week, but was timelocked for posting and have since gotten additional info. I'll post it here:
Using the ADT console command, I've gotten successful small projects to export to AAB. We had a problem with one of our homemade ANEs not targeting the newer versions of java, so we fixed that, and it can also go to an AAB on a small project. However, whenever projects with multiple resource packs and imports get involved, I continually get this info:
NOTE: Multiple Android build-tools folders exist, choosing the latest version (32.0.0 rc1) for packaging
unexpected failure: Unable to run java: com.adobe.air.ADTException: gradle tool failed: ERROR:D8: java.lang.ArrayIndexOutOfBoundsException: Index 8 out of bounds for length 8
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:desugarReleaseFileDependencies'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.DexFileDependenciesTask$DexFileDependenciesWorkerAction
> Error while dexing.
* 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 17s
java.io.IOException: Unable to run java: com.adobe.air.ADTException: gradle tool failed: ERROR:D8: java.lang.ArrayIndexOutOfBoundsException: Index 8 out of bounds for length 8
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:desugarReleaseFileDependencies'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.DexFileDependenciesTask$DexFileDependenciesWorkerAction
> Error while dexing.
* 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 17s
at com.adobe.air.apk.AABOutputStream.buildGradle(AABOutputStream.java)
at com.adobe.air.apk.AABPackager.renameOutput(AABPackager.java)
at com.adobe.air.ApplicationPackager.createPackage(ApplicationPackager.java)
at com.adobe.air.apk.AABPackager.createPackage(AABPackager.java)
at com.adobe.air.ADT.parseArgsAndGo(ADT.java)
at com.adobe.air.ADT.run(ADT.java)
at com.adobe.air.ADT.main(ADT.java)
I'm not sure what desugaring even is, but when I followed it to the AIR forums, it seemed to be a problem with dependency targets.
Is there any way to get that stack trace to work from ADT? Or any idea what that error while dexing is or how to fix it? Whenever I export from flashbuilder with the log enabled, I see this error too, then it proceeds to default to exporting the normal apk after a few tries.
Thanks again in advanced
EDIT: clarification and cleaned up code view