Status Update
Comments
sg...@google.com <sg...@google.com> #2
Folow-up:
After switching the JDK I started to get this message:
12:51 PM Project Jdk11DesugaredLibrayr is using the following JDK location when running Gradle:
/usr/local/buildtools/java/jdk
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
which was the reason for switching in the first place.
je...@google.com <je...@google.com>
ga...@google.com <ga...@google.com> #3
Søren, do you still have a copy of Jdk11DesugaredLibrayr
handy?
ga...@google.com <ga...@google.com> #4
I was able to reproduce this from studio-main
. The IDE was using 7.4.0-alpha09 with Gradle 7.5, and after that I created a new project (closed the 1st one) with AGP 3.1.0 and Gradle 4.5. But the 2nd project was still continuing to use the Gradle 7.5 for sync.
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="testRunner" value="GRADLE" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
</GradleProjectSettings>
</option>
</component>
</project>
ga...@google.com <ga...@google.com> #5
I was also able to reproduce this in EE C9. Idea log:
sg...@google.com <sg...@google.com> #6
Sorry for the late reply, I still have project Jdk11DesugaredLibrayr
, if you still need it.
ga...@google.com <ga...@google.com> #7
Looking at Jdk11DesugaredLibrayr
this is just a regular project, gradle-wrapper.properties
is
#Fri May 06 12:33:33 CEST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Although steps from #4 demonstrate the issue when trying to downgrade the Gradle version, that may be the same root cause as when trying to upgrade.
ga...@google.com <ga...@google.com> #8
Looking at #1:
I then remembered switching JDK from the local one in /use/local/buildtools/java/jdk to Studio Embedded JDK (in /usr/local/google/home/sgjesse/android-stusio/2021.3.1.9/jre). Switching back to one in /use/local/buildtools/java/jdk fixed the issue and pressing Try again synced the project.
I believe this forced the Gradle Tooling API to launch a new daemon (JDK changed), but not starting a new daemon when gradle-wrapper.properties
has changes is the actual problem.
ga...@google.com <ga...@google.com> #9
Removing this from Studio JDK
hotlist as the root cause is the IDE reusing stale Gradle connections and not starting a new daemon when gradle.properties
is updated.
xo...@google.com <xo...@google.com> #11
I submitted a cherry-pick of the intellij commit to studio-flamingo-dev. I'm working on a similar cherry-pick and a test for studio-main / Giraffe
xo...@google.com <xo...@google.com> #12
This should now be fixed in studio-main
. Thanks!
Description
gradle.properties
which was opened had had the version changed to7.4.2
. Pressing Try again to sync did not help, still the message about upgrading Gradle./use/local/buildtools/java/jdk
to Studio Embedded JDK (in/usr/local/google/home/sgjesse/android-stusio/2021.3.1.9/jre
). Switching back to one in/use/local/buildtools/java/jdk
fixed the issue and pressing Try again synced the project.See attached screenshot of trying "Change Gradle version in Gradle wrapper to 7.4.2 and re-import project" several times.