Error while exporting to android (AAB)

I’m currently trying to export a video game to aab so I can upload it to google play console. I followed all the steps in the documentation, except that when trying to export the project, I have the following errors:

 editor/export/editor_export_platform.h:182 - Exportar: Building of Android project failed, check output for the error:
  
  WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 33
  
  This Android Gradle plugin (7.2.1) was tested up to compileSdk = 32
  
  This warning can be suppressed by adding
      android.suppressUnsupportedCompileSdk=33
  to this project's gradle.properties
  
  The build will continue, but you are strongly encouraged to update your project to
  use a newer Android Gradle Plugin that has been tested with compileSdk = 33
  > Task :preBuild UP-TO-DATE
  > Task :preDebugBuild UP-TO-DATE
  > Task :assetPacks:installTime:generateAssetPackManifest UP-TO-DATE
  > Task :processDebugAssetPackManifests UP-TO-DATE
  > Task :linkDebugManifestForAssetPacks UP-TO-DATE
  > Task :assetPackDebugPreBundleTask UP-TO-DATE
  > Task :compileDebugRenderscript NO-SOURCE
  > Task :generateDebugResValues UP-TO-DATE
  > Task :generateDebugResources UP-TO-DATE
  > Task :mergeDebugResources UP-TO-DATE
  > Task :mapDebugSourceSetPaths UP-TO-DATE
  > Task :createDebugCompatibleScreenManifests UP-TO-DATE
  > Task :extractDeepLinksDebug UP-TO-DATE
  > Task :processDebugMainManifest UP-TO-DATE
  > Task :processDebugManifest UP-TO-DATE
  > Task :processApplicationManifestDebugForBundle UP-TO-DATE
  > Task :bundleDebugResources UP-TO-DATE
  > Task :mergeDebugShaders UP-TO-DATE
  > Task :compileDebugShaders NO-SOURCE
  > Task :generateDebugAssets UP-TO-DATE
  > Task :mergeDebugAssets UP-TO-DATE
  > Task :compileDebugAidl NO-SOURCE
  > Task :generateDebugBuildConfig UP-TO-DATE
  > Task :checkDebugAarMetadata UP-TO-DATE
  > Task :processDebugManifestForPackage UP-TO-DATE
  > Task :processDebugResources UP-TO-DATE
  > Task :compileDebugKotlin NO-SOURCE
  > Task :processDebugJavaRes NO-SOURCE
  > Task :mergeDebugJavaResource UP-TO-DATE
  > Task :checkDebugDuplicateClasses UP-TO-DATE
  > Task :desugarDebugFileDependencies UP-TO-DATE
  > Task :mergeExtDexDebug UP-TO-DATE
  > Task :mergeLibDexDebug UP-TO-DATE
  > Task :javaPreCompileDebug UP-TO-DATE
  > Task :compileDebugJavaWithJavac FAILED
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  Execution failed for task ':compileDebugJavaWithJavac'.
  > Could not resolve all files for configuration ':androidJdkImage'.
     > Failed to transform core-for-system-modules.jar to match attributes {artifactType=_internal_android_jdk_image, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
        > Execution failed for JdkImageTransform: C:\Users\leosa\AppData\Local\Android\Sdk\platforms\android-33\core-for-system-modules.jar.
           > Error while executing process C:\Program Files\Eclipse Adoptium\jdk-21.0.2.13-hotspot\bin\jlink.exe with arguments {--module-path C:\Users\leosa\.gradle\caches\transforms-3\d9e61f9f74d6ef325d7a2a9d1e3ac527\transformed\output\temp\jmod --add-modules java.base --output C:\Users\leosa\.gradle\caches\transforms-3\d9e61f9f74d6ef325d7a2a9d1e3ac527\transformed\output\jdkImage --disable-plugin system-modules}
  
  * 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 3s
  26 actionable tasks: 1 executed, 25 up-to-date

And no external resource has helped me solve this problem. Do you have any idea how to solve it?

im having the same problem and i tried a lot of things and asked for help but couldnt get any either. i havent tried it yet but i think it might have to be something with the jdk.

1 Like

From what I understand there are 2 errors. One that tells you that grandle is out of date, which can be ignored by putting a specific line in grandle.properties using Android Studio, which did and effectively disappears the error. And the second error I have no idea why it occurs but I think it is related to java.

yeah the issue related to java that means like the sdk is wrong or something because like the sdk java is outdated and cant export correctly

1 Like

Yeah, but, in my case, i downloaded the last sdk from the officisl web Page today, so it doesnt have sense. I am thinking it could be related with the android export template we install from godot. But idk

so what do you suggest trying

Well thinking about it i dont think that the android export template is the problem. In the exporting for android in the godot documentation ( Exporting for Android — Godot Engine (stable) documentation in English ) it says to install the JDK17 but what if we install the latest one (22)? I will try that

yeah i didn’t really think that the export template download would be the problem. it talks about JDK 21.0 in the code so its likely something to do with that. tell me if doing that works and if it doesn’t, then I’ll try to look into it more and if i don’t find anything, I’ll just uninstall everything and see if that works

Ok, what I did was install the latest version of jdk (22), but not through eclipse adoptium, I did it from the oracle page (Java Downloads | Oracle ). When configuring the java path, I tried again, but unfortunately I got another error different from the previous one:

editor/export/editor_export_platform.h:182 - Exportar: Building of Android project failed, check output for the error:
  
  Starting a Gradle Daemon, 2 incompatible Daemons could not be reused, use --status for details
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  Unable to start the daemon process.
  This problem might be caused by incorrect configuration of the daemon.
  For example, an unrecognized jvm option is used.
  Please refer to the User Manual chapter on the daemon at https://docs.gradle.org/7.4.2/userguide/gradle_daemon.html
  Process command line: C:\Program Files (x86)\Java\jre-1.8\bin\java.exe -Xmx4536m -Dfile.encoding=windows-1252 -Duser.country=MX -Duser.language=es -Duser.variant -cp C:\Users\leosa\.gradle\wrapper\dists\gradle-7.4.2-bin\48ivgl02cpt2ed3fh9dbalvx8\gradle-7.4.2\lib\gradle-launcher-7.4.2.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 7.4.2
  Please read the following process output to find out more:
  -----------------------
  Invalid maximum heap size: -Xmx4536m
  The specified size exceeds the maximum representable size.
  Error: Could not create the Java Virtual Machine.
  Error: A fatal exception has occurred. Program will exit.
  
  
  * 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

I really dont know it was because of the jdk version. but I think it has to be the openjdk mandatory :l

okay im not sure then. i just looked at it for a few minutes and cant really get any ideas. it says that we need a new Gradle plugin because we are using a compilesdk 33 when the android Gradle is only tested for 32. maybe we need to get a older version for something we installed?

i found this online.

this guy has a version that supports sdk33 which we are using. i think maybe we need to get a updated andriod template or updated gradle

im looking at a bunch of stuff and i think it might have something to do with andriod studio

Yes it could be related with android studio. With the page taht you send me, I reproduced this steps


But the same error still appears :face_exhaling:

I changed the version to 8.1.1

My problem hypothesis is that the android export template in this moment is useless because like there says, it is waiting for a major update, and thats why all youtubers who show godot exportation to android dont have errors like ours. It will be wait a few weeks :v

im trying a bunch of stuff and i think im getting somewhere. i just need to find out how to like install the stuff on andriod studio or something. ill let you know if anything works its kind of confusing

Ok I thank you so much😁, i was going to say you that dont tru to delete everythibg and restars the progress, I copied the godot project into another computer and it appears the same error

i found this post which has like word for word our exact problem. havent read through it yet wanna take a look

edit;
ive been at this for 2 hours so im gonna try again tomorrow, but im kind of at dead end. if you get any ideas then let me know.

Ok tomorrow I will completely read that and try again also, if I get ideas i tell you :+1:

Hello @sethrellhood, today after many attempts I was able to export the aproject in aab without errors. What I did is to manually delete the android folder on the project folder, then I also uninstalled all the JDK I had installed, then in godot editor settings in the manage export templates, I selected the template from the Github archive and click Download and Install. After that I openned the build folder with android studio, and I went to
File → Settings → File | Settings | Build, Execution, Deployment → Build Tools → Gradle and selected and installed the 17.0.9 jkd version from there:


I waited for it to finish installing and then I openned the Export tab in godot and i didnt really change anything there and I was able to export the proyect with debug without errors

Let me now if you by doing this solved the problem

1 Like

i tried doing this and it didnt work. i did everything you said besides uninstalling all the JDK you had. what did you mean by that

what android sdk do you have


image
and the version here