Skip to content

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
oobagi:fix/android-expo-sdk-55-kotlin-2x
Open

fix: android build on Expo SDK 55 / RN 0.83 / Kotlin 2.x#1197
oobagi wants to merge 1 commit intoreact-native-menu:masterfrom
oobagi:fix/android-expo-sdk-55-kotlin-2x

Conversation

@oobagi
Copy link
Copy Markdown

@oobagi oobagi commented Apr 16, 2026

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 the newArchEnabled gradle property since new arch is now the only option. Without it the function defaults to false, the com.facebook.react plugin 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.kt setter breaks under K2#1156 switched to property syntax for hitSlopRect, but K2 rejects super.hitSlopRect = value because it's val in the ReactHitSlopView interface. The self-assignment mHitSlopRect = value inside its own setter is also infinite recursion. Same bug that was fixed in v1.0.0 via #746. This PR uses the field keyword instead.

Closes #1167, Fixes #1058
Related: #1179, #1186, #1187

Test Plan

  • Build an Expo SDK 55 project with @react-native-menu/menu on Android
  • Verify MenuView renders and popup opens on tap
  • Verify hit slop works without stack overflow
  • Verify old arch builds still work (property present and set to "true"/"false")

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>
@oobagi oobagi requested a review from Naturalclar as a code owner April 16, 2026 09:42
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

Successfully merging this pull request may close these issues.

Bug Report: "Val cannot be reassigned" error regression in v2.0.0 MenuView fails on iOS (Unimplemented) + Android (View config missing)

1 participant