(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 in gradle.properties.

In editor settings, we've got only Android SDK path settings, not JDK.

    JusTiCe8 (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)")

    Yes, you can. 🤨

    Next to the reply button is a dropdown arrow that opens a menu. Rename should be an option in there for you.

      JusTiCe8 changed the title to Help on set-up Godot to export project to Android (when Android Studio is ok) .

      Megalomaniak Yes, you can. 🤨

      Next to the reply button is a dropdown arrow that opens a menu. Rename should be an option in there for you.

      DDoohhh !!! I just thought of editing title in the edit window, to my defence, it's quite not very intuitive. Thanks.

        JusTiCe8 Yeah, I had a double take and went checking forum settings since we recently switched hosts, so was worried something went wrong with that. But no it was configured right. As for obviousness, yeah I guess so. It worked the same with the previous forum software and plenty seemed to be confused about how the drop-downs next to buttons work. Or that options such as this could be found there.

        As for the on topic matter, I can't help since I don't use nor develop for android(or any smartphone for that matter). Sorry.