Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kotlin stdlib does not match Gradle's embedded Kotlin version #51

Open
aSemy opened this issue Mar 16, 2024 · 0 comments
Open

Kotlin stdlib does not match Gradle's embedded Kotlin version #51

aSemy opened this issue Mar 16, 2024 · 0 comments

Comments

@aSemy
Copy link
Contributor

aSemy commented Mar 16, 2024

When I look in the .module metadata for the Gradle plugins I can see that they have a dependency on kotlin-stdlib 1.9.22

      "dependencies": [
        {
          "group": "org.jetbrains.kotlin",
          "module": "kotlin-stdlib",
          "version": {
            "requires": "1.9.22"
          }
        }
      ],

https://plugins.gradle.org/m2/androidx/build/gradle/gcpbuildcache/gcpbuildcache/1.0.0-beta07/

The dependency is automatically added by the Kotlin JVM plugin.

This does not match the version of Kotlin that is embedded with Gradle. In fact, in order to be compatible with a wide range of Gradle version no dependency should be specified at all. The Kotlin stdlib dependency will be provided at runtime by Gradle.

Suggestions

  • Replace the Kotlin/JVM plugin with the embedded-kotlin plugin (I recommend this, it's easier!)

      // build.gradle.kts
      plugins {
          id("maven-publish")
          id("signing")
          id("bundle")
          alias(libs.plugins.gradle.publish)
    -     alias(libs.plugins.kotlin.jvm)
    +     `embedded-kotlin`
      }
  • Manually exclude the kotlin-stdlib dependency (for an example, see Dokka Gradle Plugin).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant