Skip to content

Request to upgrade Kotlin compiler #56522

Closed

Description

@mcorner

Description

The current Kotlin compiler version in RN is 2.1.20. The newest Kotlin compiler is 2.3.20.

The general rule is that the Kotlin compiler is forwards compatible one minor version:

"Preferably (but we can't guarantee it), the binary format is mostly forwards compatible with the next language release, but not later ones (in the cases when new features are not used, for example, 1.9 can understand most binaries from 2.0, but not 2.1)."

Many Google SDKs, including one I maintain, (and others) use the latest release of the Kotlin compiler and are now incompatible with RN.

Thanks.

Steps to reproduce

Add a newer dependency such as: implementation("com.google.android.gms:play-services-media-effect-enhancement:16.0.0-beta03")

React Native Version

0.85.2

Affected Platforms

Runtime - Android

Output of npx @react-native-community/cli info

N/A

Stacktrace or Logs

file:///Users/markcorner/.gradle/caches/9.3.1/transforms/2ac25d4a7fa5e5be514882f5862f1fe4/transformed/play-services-media-effect-enhancement-16.0.0-beta03-api.jar!/META-INF/third_party.kotlin.protobuf.src.commonMain.kotlin.com.google.protobuf.kotlin_shared_runtime.kotlin_module Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.3.0, expected version is 2.1.0.

MANDATORY Reproducer

https://github.com/mcorner/kotlinrepro

Screenshots and Videos

No response

Activity

  1. added
    Needs: Repro
    on Apr 20, 2026
  2. react-native-bot commented on Apr 20, 2026

    @react-native-bot
    Collaborator

    Warning

    Missing reproducer: We could not detect a reproducible example in your issue report. Reproducers are mandatory and we can accept only one of those as a valid reproducer:


    You can read more about about it on our website: How to report a bug.

  3. mcorner commented on Apr 21, 2026

    @mcorner
    Author

    Added a proper reproducer

  4. added
    Needs: Attention
    and removed on Apr 21, 2026
  5. feihua commented on Apr 21, 2026

    @feihua

    ### build fail

    Execution failed for task ':gradle-plugin:settings-plugin:compileKotlin'.

    Could not isolate parameters org.jetbrains.kotlin.gradle.internal.transforms.BuildToolsApiClasspathEntrySnapshotTransform$Parameters_Decorated@569e6180 of artifact transform BuildToolsApiClasspathEntrySnapshotTransform
    Could not isolate value org.jetbrains.kotlin.gradle.internal.transforms.BuildToolsApiClasspathEntrySnapshotTransform$Parameters_Decorated@569e6180 of type BuildToolsApiClasspathEntrySnapshotTransform.Parameters
    > Could not resolve all files for configuration ':gradle-plugin:settings-plugin:kotlinBuildToolsApiClasspath'.
    > Could not resolve org.jetbrains.kotlin:kotlin-build-tools-impl:2.1.20.
    Required by:
    project ':gradle-plugin:settings-plugin'
    > Could not resolve org.jetbrains.kotlin:kotlin-build-tools-impl:2.1.20.
    > Could not get resource 'https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-build-tools-impl/2.1.20/kotlin-build-tools-impl-2.1.20.pom'.
    > Could not HEAD 'https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-build-tools-impl/2.1.20/kotlin-build-tools-impl-2.1.20.pom'.

  6. mcorner commented on Apr 21, 2026

    @mcorner
    Author

    See this run: https://github.com/mcorner/kotlinrepro/actions/runs/24699282335/job/72238809800

    ..."Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.3.0, expected version is 2.1.0."

    It isn't expected to compile.

  7. cortinico commented on May 21, 2026

    @cortinico
    Contributor

    See my response here:
    #56920 (comment)

    We just bumped to Kotlin 2.2.0 which should unblock this though

  8. mcorner commented on May 22, 2026

    @mcorner
    Author

    Yes thanks for that! We have to wait for it to land in a release though...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: AttentionNeeds: Repro

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions