Android | Using different JDK locations on different processes might cause Gradle to spawn multiple daemons

Viewed 1993

so I updated Android studio to 2021.1.1 canary 12 a few days ago and I'm getting this warning when building new projects:

Project BarcodeLookupLib is using the following JDK location when running Gradle:
                D:/apps/android-studio/jre // <- location of all my android projects
                Using different JDK locations on different processes might cause Gradle to
                spawn multiple daemons, for example, by executing Gradle tasks from a terminal
                while using Android Studio.
                More info...
                Select a JDK
                Do not show this warning again

when I click select a JDK new window pops up to select Gradle user home: so I selected the folder of the latest version of Gradle I have C:/Program Files/Android/Android Studio/plugins/Gradle-7.3-rc-3 and still receiving the same error screenshot of the error and the popup window

I also tried to select from the Gradle JDK: list (screenshot of the lsit), but I have no idea what to select. I don't know why "spawn multiple daemons" is not good but I paid attention to this error while trying to build Android Library on Github and I think this error is causing errors in the "jitpack.io" log. please visit this link to see the log

the full log from "jitpack.io"

Build starting...
Start: Mon Dec 13 10:29:32 UTC 2021 449ea9babe53
Git:
1.0.0-0-g0f1c92a
commit 0f1c92aa93c26b1fd8fe01768bf2f96822b22abb
Author: Fathi Mohamed 
Date:   Mon Dec 13 13:19:25 2021 +0300

    Initial commit


Found Android manifest
Android SDK version: . Build tools: 
Found gradle
Gradle build script
Found gradle version: 7.2.
Using gradle wrapper
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
Downloading https://services.gradle.org/distributions/gradle-7.2-bin.zip
.10%.20%.30%.40%.50%.60%.70%.80%.90%.100%

------------------------------------------------------------
Gradle 7.2
------------------------------------------------------------

Build time:   2021-08-17 09:59:03 UTC
Revision:     a773786b58bb28710e3dc96c4d1a7063628952ad

Kotlin:       1.5.21
Groovy:       3.0.8
Ant:          Apache Ant(TM) version 1.10.9 compiled on September 27 2020
JVM:          1.8.0_252 (Private Build 25.252-b09)
OS:           Linux 4.14.63-xxxx-std-ipv6-64 amd64

Getting tasks: ./gradlew tasks --all
0m2.925s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2

FAILURE: Build failed with an exception.

* Where:
Build file '/home/jitpack/build/app/build.gradle' line: 2

* What went wrong:
An exception occurred applying plugin request [id: 'com.android.application', version: '7.1.0-alpha12']
> 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`.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 21s
Tasks: 

WARNING:
Gradle 'install' task not found. Please add the 'maven' or 'android-maven' plugin.
See the documentation and examples: https://jitpack.io/docs/

Adding maven plugin
Found android library build file in product-country-of-origin-lookup
Running: ./gradlew clean -Pgroup=com.github.fathidevs -Pversion=1.0.0 install
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2

> Configure project :
Gradle version Gradle 7.2

FAILURE: Build failed with an exception.

* Where:
Build file '/home/jitpack/build/app/build.gradle' line: 2

* What went wrong:
An exception occurred applying plugin request [id: 'com.android.application', version: '7.1.0-alpha12']
> 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`.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.2/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 865ms
Build tool exit code: 0
Looking for artifacts...
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
Looking for pom.xml in build directory and ~/.m2
2021-12-13T10:30:03.794563368Z
Exit code: 0

ERROR: No build artifacts found
0 Answers
Related