Fixed
Status Update
Comments
em...@google.com <em...@google.com>
je...@google.com <je...@google.com>
ga...@google.com <ga...@google.com> #2
This was broken by 3bca759a5ff08352de831bb1e9b61b1ec2b3362d.
Fix (pending) is I2c2dc7b600603ee430fd0d91b23d52ea8aa29ca9.
Fix (pending) is I2c2dc7b600603ee430fd0d91b23d52ea8aa29ca9.
ka...@gmail.com <ka...@gmail.com> #3
Almost 2 months later and this is still broken
ga...@google.com <ga...@google.com> #4
Since there is no progression, I wanted to share our quick-fix for the issue.
#sdkmanager --package_file=${PATH_WORKSPACE}/packages
while read p; do echo "y" | sdkmanager "${p}"; done <${PATH_WORKSPACE}/packages
#sdkmanager --package_file=${PATH_WORKSPACE}/packages
while read p; do echo "y" | sdkmanager "${p}"; done <${PATH_WORKSPACE}/packages
ka...@gmail.com <ka...@gmail.com> #5
jb...@google.com What is the update on this?
ga...@google.com <ga...@google.com> #6
What is the status of this item?
Description
DESCRIBE THE ISSUE IN DETAIL:
AGP failed during syncing project, where there is composite build (includeBuild) of project with, in order, another composite build (i.e. nested composite build).
STEPS TO REPRODUCE:
includeBuild("../lib1")
includeBuild("../lib2")
Full example is attached.
Studio Build: Android Studio Giraffe | 2022.3.1 Canary 11 (Build #AI-223.8836.35.2231.9848316, built on March 30, 2023)
Version of Gradle Plugin: 8.1.0-alpha11
Version of Gradle: 8.0
Version of Java: JetBrains Runtime version 17.0.6
OS: Windows 11
The cause of problem is
in com.android.build.gradle.internal.ide.v2.ModelBuilder
.Look into method
getBuildName()
. There is conditionit.projectDir == currentGradle.rootProject.projectDir
According to Gradle docs, nested composite build structure is flattened, i.e. all the included (and syb-included) projects have same root. See Gradle updated docs inhttps://github.com/gradle/gradle/pull/24469/files#diff-07fc669ece55f938ee36f360129142a0576f95381ffe9c7f737ce6fe69499993
So when executing on sub-included project (lib2) the condition above will be false, because
parentGradle
will beapp
instead oflib1
parentGradle.includedBuilds
will belib1
instead oflib2
As a result,
it.projectDir === lib1
, whencurrentGradle.rootProject.projectDir === lib2
So it is needed to fix
getBuildName
to solve the problem.