Skip to content

Bump Kotlin compiler to 2.3.21#56920

Closed
mcorner wants to merge 1 commit into
facebook:mainfrom
mcorner:bump-kotlin-2.3.21
Closed

Bump Kotlin compiler to 2.3.21#56920
mcorner wants to merge 1 commit into
facebook:mainfrom
mcorner:bump-kotlin-2.3.21

Conversation

@mcorner
Copy link
Copy Markdown

@mcorner mcorner commented May 21, 2026

Summary:

Upgrade the Kotlin compiler version in the project to the latest public stable release (2.3.21).

  • Addresses Request to upgrade Kotlin compiler #56522
  • Bumped the Kotlin version from 2.2.0 to 2.3.21 in the central version catalogs of react-native and gradle-plugin.
  • Upgraded the apiVersion target to KotlinVersion.KOTLIN_2_1 in all four gradle-plugin build files (shared, react-native-gradle-plugin, settings-plugin, shared-testutil) to resolve deprecation warnings for 2.0.
  • Replaced the deprecated -Xjvm-default=all compiler option in ReactAndroid with -jvm-default=no-compatibility to avoid compilation errors under Kotlin 2.3.21.

Changelog:

[ANDROID] [CHANGED] - Bumped Kotlin version to 2.3.21 and Kotlin API version to 2.1

Test Plan:

Verified by running all local unit tests for both the Gradle plugin and the core Android library:

  1. Gradle Included Build (gradle-plugin):
    • Executed ./gradlew test in packages/gradle-plugin.
    • Result: Build and all unit tests passed successfully; compilation is clean and free of API version 2.0 deprecation warnings.
  2. Core Android Library (ReactAndroid):
    • Executed ./gradlew :packages:react-native:ReactAndroid:test in the root directory.
    • Result: Build and all unit tests passed successfully; compilation is clean and free of -Xjvm-default deprecation warnings.

Summary:
Upgrade the Kotlin compiler version in the project to the latest public stable release (2.3.21). Also bump the apiVersion to KOTLIN_2_1 in all four gradle-plugin build files to resolve deprecation warnings for 2.0, and replace the deprecated -Xjvm-default compiler option in ReactAndroid with -jvm-default=no-compatibility.

## Changelog:
[ANDROID] [CHANGED] - Bumped Kotlin version to 2.3.21 and Kotlin API version to 2.1

TAG=agy
CONV=2fc9825d-a86b-4fbb-ab9a-e7d467b57dd3
@meta-cla
Copy link
Copy Markdown

meta-cla Bot commented May 21, 2026

Hi @mcorner!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@meta-cla
Copy link
Copy Markdown

meta-cla Bot commented May 21, 2026

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 21, 2026
@meta-cla
Copy link
Copy Markdown

meta-cla Bot commented May 21, 2026

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@mcorner
Copy link
Copy Markdown
Author

mcorner commented May 21, 2026

I just saw: #56222. If that pull is going to happen, we don't need this, but one of them is needed to unblock our SDK wrapper for reCAPTCHA.

@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label May 21, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented May 21, 2026

@fabriziocucci has imported this pull request. If you are a Meta employee, you can view this in D105966180.

@mcorner
Copy link
Copy Markdown
Author

mcorner commented May 21, 2026

Actually this change here: 62038cf is sufficient to unblock us (once it lands in some release). You can accept this if you want to go another version to 2.3.21

@fabriziocucci
Copy link
Copy Markdown
Contributor

Actually this change here: 62038cf is sufficient to unblock us (once it lands in some release). You can accept this if you want to go another version to 2.3.21

That landed on main one week ago: see cb04956

The branch cut for 0.86 happened earlier so, unless we cherry pick it, it won't be included in that release.

I'll double-check internally whether we can make it.

@cortinico
Copy link
Copy Markdown
Contributor

Upgrade the Kotlin compiler version in the project to the latest public stable release (2.3.21).

This can't be merged as is. React Native follows the same version of Kotlin that is used internally at Meta.

What's the reason why you want this bump? We recently bumped to 2.2.0 which should be source compatible with 2.3 also.

@cortinico
Copy link
Copy Markdown
Contributor

That landed on main one week ago: see cb04956
The branch cut for 0.86 happened earlier so, unless we cherry pick it, it won't be included in that release.

This will land in 0.87 as the window to pick this inside 0.86 has closed + 0.86 will have no breaking changes (and this Kotlin bump is breaking instead).

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants