charleskorn
07/25/2022, 6:46 AMCould not determine the dependencies of task ':kotest-framework:kotest-framework-multiplatform-plugin-gradle:test'.
> Could not resolve all task dependencies for configuration ':kotest-framework:kotest-framework-multiplatform-plugin-gradle:testRuntimeClasspath'.
> Could not resolve project :kotest-assertions:kotest-assertions-core.
Required by:
project :kotest-framework:kotest-framework-multiplatform-plugin-gradle
> The consumer was configured to find a runtime of a library compatible with Java 8, packaged as a jar, preferably optimized for standard JVMs, and its dependencies declared externally, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm'. However we cannot choose between the following variants of project :kotest-assertions:kotest-assertions-core:
- jvmRuntimeElements
- runtimeElements
(full error in thread)charleskorn
07/25/2022, 6:47 AMkotest-framework-multiplatform-plugin-gradle
project references.charleskorn
07/25/2022, 6:49 AMVampire
07/25/2022, 6:55 AMcharleskorn
07/25/2022, 7:19 AMincludeBuild
to include the Kotest project into another project.charleskorn
07/25/2022, 7:26 AMA wild guess would be, that you maybe locally use a different Java version and because of that have different results. If so, you should consider using JVM toolchains feature to mitigate that.You might be on to something here - the build on GitHub Actions is using Java 8, whereas I have Java 18 installed locally. But this doesn’t explain the behaviour with
includeBuild
locally…
And if you can, maybe update to Gradle 7.5, the output for such errors greatly improved iirc.Just tried this, the output is the same either way. The Gradle release notes seem to suggest the improvements are for tasks such as
dependencyInsight
, charleskorn
07/25/2022, 7:29 AM./gradlew :kotest-framework:kotest-framework-multiplatform-plugin-gradle:dependencyInsight --configuration testRuntimeClasspath --dependency :kotest-assertions:kotest-assertions-core
locally shows that Gradle is selecting jvmRuntimeElements
.charleskorn
07/25/2022, 8:14 AMjava {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
…and the projects it was trying to consume did not have the same configuration. Adding that same java { … }
block to their Gradle config was enough to fix the issue.
Thanks for your help @Vampire!Vampire
07/25/2022, 8:36 AMLooks like the improved output is only shown when dependencies can be resolved successfully, not when a failure occurs.Oh, bad. 😞 Then it was probably more hope that it improved too, sorry.
Emil Kantis
08/01/2022, 9:10 PM