From 9f8a3a242c58c1935fa905d90db446f533707f58 Mon Sep 17 00:00:00 2001 From: Konstantin Date: Mon, 8 Jul 2024 14:22:28 +0200 Subject: [PATCH] [gradle] Fix task configuration (use configureEach instead all). (#5076) Fixes https://github.com/JetBrains/compose-multiplatform/issues/5061 ## Release Notes ### Fixes - Gradle Plugin - _(prerelease fix)_ Fix "InvalidUserDataException: Cannot change hierarchy of dependency configuration" on Gradle sync --- .../kotlin/org/jetbrains/compose/resources/AndroidResources.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/resources/AndroidResources.kt b/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/resources/AndroidResources.kt index afd400483e..a19baca67a 100644 --- a/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/resources/AndroidResources.kt +++ b/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/resources/AndroidResources.kt @@ -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)