From 6ed0efedd316d93cb48953174eed5354cbc95cef Mon Sep 17 00:00:00 2001 From: Yahor Berdnikau Date: Fri, 15 Apr 2022 15:19:31 +0200 Subject: [PATCH] Add workaround for Gradle dependency resolution error Gradle throws unexpected error on dependency resolution without this workaround. Related to KT-51837 --- .../tools/kotlin-gradle-plugin-api/build.gradle.kts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libraries/tools/kotlin-gradle-plugin-api/build.gradle.kts b/libraries/tools/kotlin-gradle-plugin-api/build.gradle.kts index a575b0b67b7..14070477c2d 100644 --- a/libraries/tools/kotlin-gradle-plugin-api/build.gradle.kts +++ b/libraries/tools/kotlin-gradle-plugin-api/build.gradle.kts @@ -7,5 +7,13 @@ dependencies { commonApi(project(":native:kotlin-native-utils")) commonApi(project(":kotlin-project-model")) commonImplementation(project(":kotlin-tooling-core")) - commonCompileOnly("com.android.tools.build:gradle:3.6.4") + + commonCompileOnly("com.android.tools.build:gradle:3.6.4") { + // Without it - Gradle dependency resolution fails with unexpected error + // Caused by: java.lang.IllegalStateException: Unexpected parent dependency id 131. Seen ids: [129, 2, 130, 9, 10, 138, 11, 139, 140, 14, 153, 154, 155, 156, 157, 158, 161, 164, 177, 178, 51, 179, 52, 180, 53, 54, 55, 183, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 195, 68, 200, 201, 202, 203, 206, 211, 212, 215, 222, 223, 224, 231, 232, 105, 233, 106, 107, 108, 109, 110, 111, 112, 113, 114, 242, 115, 243, 116, 244, 117, 118, 119, 120, 121, 122] + // at org.gradle.api.internal.artifacts.ivyservice.resolveengine.oldresult.TransientConfigurationResultsBuilder.deserialize(TransientConfigurationResultsBuilder.java:171) + // at org.gradle.api.internal.artifacts.ivyservice.resolveengine.oldresult.TransientConfigurationResultsBuilder.lambda$load$5(TransientConfigurationResultsBuilder.java:117) + // Could be reproduced by running `:kotlin-gradle-plugin-api:gPFFPMP` task + isTransitive = false + } }