New app, pipeline failed with bad JAVA_VERSION

Hello there,

I try to submit my application and the pipeline fdroid-build fail.

> 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`.

But my build.gradle contain:

compileOptions {
    sourceCompatibility JavaVersion.VERSION_11
    targetCompatibility JavaVersion.VERSION_11
}

What is wrong? Which value for org.gradle.java.home in gradle.properties? How can I define JAVA_HOME ?

Thanks for your advises, I’an a little bit lost…

Jacques

1 Like

You need to install java 11.

    sudo:
      - apt-get update || apt-get update
      - apt-get install -y openjdk-11-jdk-headless
      - update-alternatives --auto java
2 Likes

Hello @linsui

You mean on my dev machine?
I must admit that I am a little bit lost by the fdtoid-build process. As I understand, looking at the log, there is a docker instance generated in order to compile my project. And I have to access to this instance.

Thanks for your time, I will do your tricks.

Jacques

@jfoucry you need to add it to your yml under Builds.

For example:

Builds:
  - versionName: '3'
    versionCode: 3
    subdir: app
    sudo:
    - apt-get update || apt-get update
    - apt-get install -y openjdk-11-jdk-headless
    - update-alternatives --auto java
    gradle:
    - yes
1 Like

Hello @mendhak

Ok! That’s more clear now!

Thanks very much, I’ll try it right now and consume my last credit :slight_smile:

By the way, you don’t need to build on your own machine. It’s much more convience to open an MR and let the CI to do the rest.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.