Status Update
Comments
uc...@google.com <uc...@google.com>
xa...@google.com <xa...@google.com>
sr...@google.com <sr...@google.com>
sr...@google.com <sr...@google.com> #2
There is an issue in the way the JDK changes are handled in the PSD, can you confirm what JDK is used by the Gradle daemon? You can go to Help -> Find Action and type "Show Gradle Daemons". In that dialog you will see a list of the currently running daemons, pressing them will show details, in particular look for "Java home:", does it match to what you changed in the PSD? Or it is the embedded path?
l....@gmail.com <l....@gmail.com> #3
not OP but I have the same issue. Show Gradle Daemons
only shows one daemon, with proper java home ($JAVA_HOME). In PSD I select the same java home, but as soon as gradle sync completes, it resets to the embedded one.
The following shows in logs after choosing JAVA_HOME JDK location in PSD and clicking apply (and waiting for gradle sync to complete)
16:14 Gradle sync started
16:14 Gradle sync finished in 31 s 966 ms
16:14 Android Studio is using the following JDK location when running Gradle:
/Users/wasyl/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-1/202.6811877/Android Studio 4.2 Preview.app/Contents/jre/jdk/Contents/Home
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 from the File System
Do not show this warning again
sr...@google.com <sr...@google.com> #4
Thanks for checking!
The path in the warning message and the one shown in the PSD get the value from the same source and unfortunately there are some issues with this source, causing it to be incorrect in some circumstances (different to what is actually used). That is why I asked about the one shown in the "Show Gradle Daemons" dialog.
We have made some fixes and added a log message to reflect the actual value used on newer release. That would help debugging this issue.
ku...@gmail.com <ku...@gmail.com> #5
I didn't have this issue in AS 4.2 canary 10, but I am seeing this issue in canary 11. (build is still using AGP 4.0).
The project's SDK points to 1.8 in the Project Structure dialog, but the gradle daemon is started using Java 11 bundled with AS 4.2 as seen in the Show Gradle Daemons
dialog and also when checking System.getProperty("java.version")
in build.gradle
, it reads 11.0.7
.
I have had no success in changing it.
Strange that the release notes for canary 11 say this is fixed, but I only started experiencing it after updating to 11.
l....@gmail.com <l....@gmail.com> #6
Still an issue in 4.2 Canary 11. The workaround suggested in
I tried to work around this by going into the app package directory in ~/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-1/202.6825553/Android Studio 4.2 Preview.app
, renaming jre
directory, running AS an waiting for sync (warnings about using OpenJDK appeared) and then reverting directory change and restarting AS. However, what happened was it finally did change JDK location in the project structure dialog (see screenshot), but Gradle still uses wrong (embedded) JDK.
Just fyi, this is effectively preventing some from using and testing canary AS. If someone switches between IDE and command line often, the performance hit is difficult to accept.
dh...@linkedin.com <dh...@linkedin.com> #7
sr...@google.com <sr...@google.com> #8
There was a bug causing JDKs older than the version of Java used by Android Studio (Java 11 on Studio 4.2) to be seen as incompatible, preventing Android Studio to use them when invoking Gradle. This check will be changed in 4.2 canary 13 and should allow versions 8 or newer rather than the version used by Studio. Can you confirm you can use a different JDK once it is released?
Description
Build: AI-202.6397.94.42.6787931, 202008250249,
AI-202.6397.94.42.6787931, JRE 11.0.7+10-b765.53x64 JetBrains s.r.o, OS Mac OS X(x86_64) v10.15.6, screens 1680x1050; Retina
AS: 4.2 Canary 8; Kotlin plugin: 1.4.0-release-Studio4.1-1; Android Gradle Plugin: 4.2.0-alpha08; Gradle: 6.6.1; NDK: from local.properties: (not specified), latest from SDK: (not found); LLDB: LLDB 3.1 (revision: 3.1.4508709); CMake: from local.properties: (not specified), latest from SDK: 3.10.2, from PATH: (unable to invoke cmake)
IMPORTANT: Please readhttps://developer.android.com/studio/report-bugs.html carefully and supply all required information.
I am unable to set JDK location to SDKMAN current path. No matter what I do, JDK location is reset to embedded JDK. This wasnt and issue with Android Studio 4.2-alpha07.