Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Build failure on React Native 0.78 – Kotlin compilation error in MenuViewManagerBase.kt #1041

Open
mickyfazler opened this issue Feb 21, 2025 · 3 comments

Comments

@mickyfazler
Copy link

After upgrading our React Native app from 0.77 to 0.78, our Android build now fails due to a Kotlin compilation error in the react‑native‑menu package. The error message is:

> Task :react-native-menu_menu:compileDebugKotlin FAILED
...
file:///.../node_modules/@react-native-menu/menu/android/src/main/java/com/reactnativemenu/MenuViewManagerBase.kt:209:10 'val' cannot be reassigned.

Steps to Reproduce:

  1. Upgrade the project from React Native 0.77 to 0.78.
  2. Run npm install or yarn install to update dependencies.
  3. Build the Android app using react-native run-android (or your preferred build command).
  4. Observe the build failure with the above Kotlin error.

Environment Details:

  • React Native version: 0.78
  • OS: Windows 11

Expected Behavior:
The app should build successfully without encountering Kotlin compilation errors.

I really appreciate big developers time and energey. They are my heros and oneday will be like them sothat i also can contribue instead of issueing 🫡💓

@MdWahiduzzamanEmon
Copy link

is any update? i am also facing the same issue

@lluiscab
Copy link
Contributor

lluiscab commented Mar 6, 2025

The following change resolves the issue but I'm not sure if introducing this change means dropping support for any versions of react-native less than 0.78.0. In my case that wouldn't be a problem but I'm not opening a PR because I'm unsure on how this change might affect other react-native versions.

diff --git a/android/src/main/java/com/reactnativemenu/MenuViewManagerBase.kt b/android/src/main/java/com/reactnativemenu/MenuViewManagerBase.kt
index 0cd90f4..4731e1a 100644
--- a/android/src/main/java/com/reactnativemenu/MenuViewManagerBase.kt
+++ b/android/src/main/java/com/reactnativemenu/MenuViewManagerBase.kt
@@ -206,7 +206,7 @@ abstract class MenuViewManagerBase : ReactClippingViewManager<MenuView>() {
 
   @ReactProp(name = ViewProps.OVERFLOW)
   fun setOverflow(view: ReactViewGroup, overflow: String?) {
-    view.overflow = overflow
+    view.setOverflow(overflow)
   }

@Naturalclar could you take a look at this patch?

@withSang
Copy link

The following change resolves the issue but I'm not sure if introducing this change means dropping support for any versions of react-native less than 0.78.0. In my case that wouldn't be a problem but I'm not opening a PR because I'm unsure on how this change might affect other react-native versions.

diff --git a/android/src/main/java/com/reactnativemenu/MenuViewManagerBase.kt b/android/src/main/java/com/reactnativemenu/MenuViewManagerBase.kt
index 0cd90f4..4731e1a 100644
--- a/android/src/main/java/com/reactnativemenu/MenuViewManagerBase.kt
+++ b/android/src/main/java/com/reactnativemenu/MenuViewManagerBase.kt
@@ -206,7 +206,7 @@ abstract class MenuViewManagerBase : ReactClippingViewManager() {

@ReactProp(name = ViewProps.OVERFLOW)
fun setOverflow(view: ReactViewGroup, overflow: String?) {

  • view.overflow = overflow
  • view.setOverflow(overflow)
    }
    @Naturalclar could you take a look at this patch?

I can confirm this fix works on RN 0.78.0. Thanks a lot!!!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants