Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
[ID: 558956]
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Attachment actions
Description
(Extracted fromhttp://issuetracker.google.com/212674413#comment16 .)
Steps to reproduce
Open a simple project with a (see attached)
build-logic
included buildRun
ps ax | grep GradleDaemon
and take note of the Gradle daemons and their versions (run./gradlew --stop
if necessary)Run
Clean Project
from Android StudioRun
ps ax | grep GradleDaemon
again. Observe that there are multiple Gradle daemons with different versions (one is the Gradle wrapper version specified in the project, and the other is the Gradle Tooling API version that Android Studio uses).Expected behavior
Only 1 Gradle daemon should be launched, with the version specified in the project.
Potential root cause
The relevant code seems to be at GradleBuildInvokerImpl.kt :
This is roughly equivalent to running:
Since there is no Gradle version specified in the
build-logic
included project, Gradle will start a new daemon with the version of the Gradle Tooling API that is being used.Workaround
Copy
gradle/wrapper/gradle-wrapper.jar
andgradle/wrapper/gradle-wrapper.properties
from the main project to the included project. This will allow Gradle to use the version specified in the included project, which is now the same as the main project.Also copy
gradle.properties
from the main project to the included project too. This is so that Gradle can reuse the same daemon, otherwise there would be 2 Gradle daemons having the same version.