touchlab / Kermit

Kermit by Touchlab is a Kotlin Multiplatform centralized logging utility.
https://kermit.touchlab.co
Apache License 2.0
699 stars 40 forks source link

Could not resolve org.jetbrains.kotlin:kotlin-test-junit5:1.9.10 #383

Closed JohannesPtaszyk closed 7 months ago

JohannesPtaszyk commented 10 months ago

Hey I just updated my dependency to 2.0.2 and I am facing this issue in my android project whenever I try to run tests.

Project can be found here: https://github.com/JohannesPtaszyk/Abonity

* What went wrong:
Could not determine the dependencies of task ':core:ui:testDebugUnitTest'.
> Could not resolve all task dependencies for configuration ':core:ui:debugUnitTestRuntimeClasspath'.
   > Could not resolve org.jetbrains.kotlin:kotlin-test-junit5:1.9.10.
     Required by:
         project :core:ui > org.jetbrains.kotlin:kotlin-test:1.9.10
      > Module 'org.jetbrains.kotlin:kotlin-test-junit5' has been rejected:
           Cannot select module with conflict on capability 'org.jetbrains.kotlin:kotlin-test-framework-impl:1.9.10' also provided by [org.jetbrains.kotlin:kotlin-test-junit:1.9.10(junitRuntime)]
   > Could not resolve org.jetbrains.kotlin:kotlin-test-junit:1.9.10.
     Required by:
         project :core:ui > co.touchlab:kermit:2.0.2 > co.touchlab:kermit-android-debug:2.0.2
      > Module 'org.jetbrains.kotlin:kotlin-test-junit' has been rejected:
           Cannot select module with conflict on capability 'org.jetbrains.kotlin:kotlin-test-framework-impl:1.9.10' also provided by [org.jetbrains.kotlin:kotlin-test-junit5:1.9.10(junit5Runtime)]
hanrw commented 10 months ago

same issue

      > Module 'org.jetbrains.kotlin:kotlin-test-junit5' has been rejected:
           Cannot select module with conflict on capability 'org.jetbrains.kotlin:kotlin-test-framework-impl:1.9.10' also provided by [org.jetbrains.kotlin:kotlin-test-junit:1.9.10(junitRuntime)]
   > Could not resolve org.jetbrains.kotlin:kotlin-test-junit:1.9.10.
     Required by:
         project :infrastructure > co.touchlab:kermit:2.0.2 > co.touchlab:kermit-jvm:2.0.2
      > Module 'org.jetbrains.kotlin:kotlin-test-junit' has been rejected:
           Cannot select module with conflict on capability 'org.jetbrains.kotlin:kotlin-test-framework-impl:1.9.10' also provided by [org.jetbrains.kotlin:kotlin-test-junit5:1.9.10(junit5Runtime)]
manriif commented 10 months ago

Same issue, I can no longer run tests.

Could not determine the dependencies of task ':backend:supabase:supabase-backend:desktopTest'.
> Could not resolve all task dependencies for configuration ':backend:supabase:supabase-backend:desktopTestRuntimeClasspath'.
   > Could not resolve org.jetbrains.kotlin:kotlin-test-junit5:1.9.20.
     Required by:
         project :backend:supabase:supabase-backend > org.jetbrains.kotlin:kotlin-test:1.9.20
      > Module 'org.jetbrains.kotlin:kotlin-test-junit5' has been rejected:
           Cannot select module with conflict on capability 'org.jetbrains.kotlin:kotlin-test-framework-impl:1.9.20' also provided by [org.jetbrains.kotlin:kotlin-test-junit:1.9.10(junitRuntime)]
   > Could not resolve org.jetbrains.kotlin:kotlin-test-junit:1.9.10.
     Required by:
         project :backend:supabase:supabase-backend > project :cyc-libs:dev > co.touchlab:kermit:2.0.2 > co.touchlab:kermit-jvm:2.0.2
      > Module 'org.jetbrains.kotlin:kotlin-test-junit' has been rejected:
           Cannot select module with conflict on capability 'org.jetbrains.kotlin:kotlin-test-framework-impl:1.9.10' also provided by [org.jetbrains.kotlin:kotlin-test-junit5:1.9.20(junit5Runtime)]
manriif commented 10 months ago

Found a workaround that is closer to a permanent solution. The code below should be applied to all projects, including those available through composite builds, that have a direct or transitive dependency on kotlin-test-junit. You can apply once using subproject in root build.gradle.kts. Replace kotlin-test-junit with kotlin-test-junit5 depending on your version of JUnit.

configurations
    .matching { it.name.endsWith("TestRuntimeClasspath") }
    .configureEach {
        exclude(group = "org.jetbrains.kotlin", module = "kotlin-test-junit")
    }
JohannesPtaszyk commented 10 months ago

Thank you! Sounds like a thing that can be used, while waiting for a fix :)