Android JAVA_HOME from Wappler editor

As I inspect your second screenshot more carefully you seem to have selected for Gradle JDK - ver 11 JRE

You should select the default Android Studio JDK there…

I've tried changing the gradle JDK to all that are listed...no difference is seen on the Wappler side.

I get errors though within Android studio if I don't use Java 11:

A problem occurred evaluating project ':app'.

Failed to apply plugin 'com.android.internal.application'.
Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
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.

Well welcome to the wonder world of Java versions….

And Cordova requires Java 1.8 and not 11

As of Cordova Android 10, it supports Java 11, right?

https://cordova.apache.org/announcements/2021/07/20/cordova-android-10.0.0.html

Well seems the JDK is no longer bundled with the latest Android studio.

Will add more checks about it and don’t force set the JAVA_HOME if already set or the jdk is not found.

Hope that will fix it.

1 Like

This has been fixed in Wappler 4.3.1

The error I receive has changed, but still receiving an error:

Building your Cordova Project for android ...
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=/Users/pauka/Library/Android/sdk (recommended setting)
ANDROID_HOME=/Users/pauka/Library/Android/sdk (DEPRECATED)
Using Android SDK: /Users/pauka/Library/Android/sdk
Reading build config file: /Users/pauka/WapplerProjects/mpp_mobile/build.json
Subproject Path: CordovaLib
Subproject Path: app

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/pauka/WapplerProjects/mpp_mobile/platforms/android/app/build.gradle' line: 20

* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin 'com.android.internal.application'.
   > Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
     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`.

@George The project is set to 11, but the build in wappler is still attempting 1.8. I’ve tried removing JAVA_HOME completely, and receive the same error. It still builds in Android Studio.

Ideas?