fix: android build on Expo SDK 55 / RN 0.83 / Kotlin 2.x#1197
Open
oobagi wants to merge 1 commit intoreact-native-menu:masterfrom
Open
fix: android build on Expo SDK 55 / RN 0.83 / Kotlin 2.x#1197oobagi wants to merge 1 commit intoreact-native-menu:masterfrom
oobagi wants to merge 1 commit intoreact-native-menu:masterfrom
Conversation
1. isNewArchitectureEnabled() defaults to true when newArchEnabled property is absent (removed in RN 0.83 since new arch is the only option). 2. MenuView.kt mHitSlopRect setter uses `field` keyword instead of super.hitSlopRect (rejected by K2 compiler) and recursive self- assignment. Closes react-native-menu#1167, Fixes react-native-menu#1058 Related: react-native-menu#1179, react-native-menu#1186, react-native-menu#1187 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Overview
v2.0.0 doesn't build on Android with Expo SDK 55 (RN 0.83, Kotlin 2.1.20). Two issues:
isNewArchitectureEnabled()returns false on RN 0.83+ — RN 0.83 removed thenewArchEnabledgradle property since new arch is now the only option. Without it the function defaults to false, thecom.facebook.reactplugin never gets applied, oldarch sources are used, and codegen is skipped. Result: "View config not found for component MenuView" at runtime. This PR defaults to true when the property is absent.MenuView.ktsetter breaks under K2 — #1156 switched to property syntax forhitSlopRect, but K2 rejectssuper.hitSlopRect = valuebecause it'svalin theReactHitSlopViewinterface. The self-assignmentmHitSlopRect = valueinside its own setter is also infinite recursion. Same bug that was fixed in v1.0.0 via #746. This PR uses thefieldkeyword instead.Closes #1167, Fixes #1058
Related: #1179, #1186, #1187
Test Plan
@react-native-menu/menuon Android