Status Update
Comments
ya...@google.com <ya...@google.com>
je...@google.com <je...@google.com>
je...@google.com <je...@google.com> #2
Hello, I have tried to reproduce the issue with the provided test case (thanks for that !) and it passed successfully for me... Am I missing something ?
~/bugs/b328852035/static-variant-sources-bug-repro î‚° î‚ develop î‚° ./gradlew -Pandroid.enableBuildConfigAsBytecode=true :app:myTaskDebug
Downloading https://services.gradle.org/distributions/gradle-8.6-bin.zip
............10%.............20%............30%.............40%.............50%............60%.............70%.............80%............90%.............100%
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
> Configure project :app
WARNING: The option setting 'android.enableBuildConfigAsBytecode=true' is experimental.
The current default is 'false'.
> Task :app:myTaskDebug
Hello, world
BUILD SUCCESSFUL in 35s
1 actionable task: 1 executed
~/bugs/b328852035/static-variant-sources-bug-repro î‚° î‚ develop î‚°
se...@team.bumble.com <se...@team.bumble.com> #3
#2 thanks for looking into this. android.enableBuildConfigAsBytecode=true
is a workaround I provided just in case if it would give any hints at the culprit.
The build should pass without any flags when running ./gradlew :app:myTaskDebug
, if SourceDirectories.Flat#static
didn't depend on BuildConfig generation task.
je...@google.com <je...@google.com> #4
ah yes sorry, did not read carefully, I can repro now. thanks
je...@google.com <je...@google.com> #5
Change-Id: I06ce8f50c359dadc03b5c7f58c590df29de4b51a
an...@google.com <an...@google.com> #7
Thank you for your patience while our engineering team worked to resolve this issue. A fix for this issue is now available in:
- Android Studio Koala | 2023.3.2 Canary 2
- Android Gradle Plugin 8.5.0-alpha02
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
Thank you for taking the time to submit feedback — we really appreciate it!
md...@gmail.com <md...@gmail.com> #8
Bank si ho
je...@google.com <je...@google.com> #9
merged in 8-4 RC branch.
an...@google.com <an...@google.com> #10
The fixes for this issue are now also available in:
- Android Studio Jellyfish | 2023.3.1 Beta 2
- Android Gradle Plugin 8.4.0-beta02
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
Description
SourceDirectories.Flat#static
which was introduced in AGP 8.4, depends onGenerateBuildConfig
task which is unexpected and looks like a bug since the sources are supposed to be static unlikeSourceDirectories.Flat#all
which includes generated sources.A consequence of this is that static Variant source directories cannot be resolved during the configuration phase using the new Variant API when
BuildConfig
generation is enabled.Resolving
SourceDirectories.Flat#static
during the configuration phase results in the following error:AGP version: 8.4.0-alpha13https://github.com/technoir42/static-variant-sources-bug-repro
Relates to b/266681484
Repro project: