Repository navigation
Fix Kotlin 2.3 warnings in Android Gradle builds - #59548
Open
Abbondanzo wants to merge 1 commit into
Open
Abbondanzo wants to merge 1 commit into
Abbondanzo wants to merge 1 commit into
Conversation
|
@Abbondanzo has exported this pull request. If you are a Meta employee, you can view the originating Diff in D127831836. |
Summary: Kotlin 2.3 introduced warnings that fail the Android Gradle builds when warnings are treated as errors: - API version 2.0 is deprecated. Bump `apiVersion` to `KOTLIN_2_1` in the four gradle-plugin build files, as the previous Kotlin upgrade did when it moved from 1.9 to 2.0. Gradle 9, which React Native requires, ships a Kotlin 2.2 runtime, so the plugin still loads on every supported Gradle version. - `-Xjvm-default` is deprecated in favor of `-jvm-default`. Replace `-Xjvm-default=all` in `ReactAndroid` with its equivalent, `jvmDefault = JvmDefaultMode.NO_COMPATIBILITY`. - Kotlin 2.3 reports unnecessary non-null assertions after a smart cast. Remove the redundant `!!` in `JsonUtilsTest`. Changelog: [Android][Changed] - Bumped the Gradle plugin minimum Kotlin API version to 2.1 Reviewed By: andrewdacenko Differential Revision: D127831836
Abbondanzo
force-pushed
the
export-D127831836
branch
from
October 27, 2026 16:34
e09adcc to
79f3b48
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Kotlin 2.3 introduced warnings that fail the Android Gradle builds when warnings are treated as errors:
apiVersiontoKOTLIN_2_1in the four gradle-plugin build files, as the previous Kotlin upgrade did when it moved from 1.9 to 2.0. Gradle 9, which React Native requires, ships a Kotlin 2.2 runtime, so the plugin still loads on every supported Gradle version.-Xjvm-defaultis deprecated in favor of-jvm-default. Replace-Xjvm-default=allinReactAndroidwith its equivalent,jvmDefault = JvmDefaultMode.NO_COMPATIBILITY.!!inJsonUtilsTest.Changelog:
[Android][Changed] - Bumped the Gradle plugin minimum Kotlin API version to 2.1
Reviewed By: andrewdacenko
Differential Revision: D127831836