- Edited
(EDIT: too bad we can't edit title, made a mistake ! It should be "Help on set-up Godot to export project to Android (when Android Studio is ok)")
Hi,
does anyone here have a working Android Studio set-up and succeed to also set-up Godot 4 to be able to export to Android ? If yes could you share what you've set to make this work please ?
I have AS Dolphin 2021.3.1 Patch1 which work perfectly, I'm able to create Android app for various version (mostly 4.4 & 8.0), Android SDK installed are 8.1, 11.0, 12L (I'm surprised to not see 4.4 in the list), AS use a provided JDK ("AS default JDK" option set in Gradle JDK option from project/build,exec,deploy. config) version 11.0.13.
The great advantage of AS is it's work right away out of the box, I've tried Visual Studio/Xamarin thing before and nothing works as it should (emulator doesn't even work for instance).
Godot seems to be closer to MS things than Google ones, that's quite poor, as when I tried, Godot generate some gradle scripts which use some JDK version without any way to define which one to use from the editor (there are only min & target version, not any location !!), I got this quite typical error:
- What went wrong:
An exception occurred applying plugin request [id: 'com.android.application', version: '7.2.1']
Failed to apply plugin 'com.android.internal.application'.
Android Gradle plugin requires Java 11 to run. You are currently using Java 1.9.
Your current JDK is located in D:\Program Files\Java\jre-9.0.4
You can try some of the following options:
- changing the IDE settings.
- changing the JAVA_HOME environment variable.
- changing
org.gradle.java.home
ingradle.properties
.
In editor settings, we've got only Android SDK path settings, not JDK.