Skip to content

Commit

Permalink
[gradle] Fix task configuration (use configureEach instead all). (#5076)
Browse files Browse the repository at this point in the history
Fixes #5061

## Release Notes
### Fixes - Gradle Plugin
- _(prerelease fix)_ Fix "InvalidUserDataException: Cannot change
hierarchy of dependency configuration" on Gradle sync
  • Loading branch information
terrakok committed Jul 8, 2024
1 parent f01f195 commit 9f8a3a2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ internal fun Project.configureAndroidAssetsForPreview() {

if (androidComponents.pluginVersion >= agp_8_1_0) {
// addGeneratedSourceDirectory doesn't mark the output directory as assets hence AS Compose Preview doesn't work
tasks.all { task ->
tasks.configureEach { task ->
if (task.name == kgpCopyAssetsTaskName) {
task.outputs.files.forEach { file ->
addStaticSourceDirectory(file.path)
Expand Down

0 comments on commit 9f8a3a2

Please sign in to comment.