How to tell Appflow to use Java 11 instead of 1.8? (Build Error)

Hello,

please see the following message:

Appflow can’t detect the gradle plugin version and uses java 1.8 instead of 11. Because of this reason, the build isn’t working. Full Error Message:

> Task :capacitor-android:compileReleaseJavaWithJavac
An exception has occurred in the compiler (1.8.0_312). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you.
java.lang.AssertionError: annotationType(): unrecognized Attribute name MODULE (class com.sun.tools.javac.util.UnsharedNameTable$NameImpl)

What can I do to make Appflow recognizing the gradle plugin version and use Java 11?

Regards,
Marius

Hi,

you can try this:

Hello,
if that is a capacitor app, can you please tell us how your
<project>/android/build.gradle
looks like?

Thanks,
Giovanni

1 Like

Hello,

we have the same problem.

We have the Appflow Community subscription, so unfortunately we can’t set an environment variable.

How can I define which JAVA version should be used?

It’s about a Cordova app.

It should auto detect based on your gradle version.
Have you configured a specific gradle version?
If not, what’s your cordova-android version?

Yes, I also tried to set a special Gradle version.

Here, however, only the standard Gradle version 4.3.1 is loaded. The specified Gradle version will then be installed during the build (e.g. 7.1.1).
However, Java 8 will still be used.
Maybe the specially set Gradle version is not taken into account here, but only the 4.3.1?

I contacted Ionic Support and can now set the environment variable OVERRIDE_JAVA_VERSION.

Hi @felix741 , I have the same issue, I am also in Community subscription.
How have you managed to access OVERRIDE_JAVA_VERSION without upgrading to Basic?

As Felix741, I have contacted Ionic support and now I can set environment variable during the build process (still community subscriptio) :+1: