Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

React Native Upgrade 0.76.6 to 0.77 - Build Fails with Kotlin Compilation Errors #1021

Open
mickyfazler opened this issue Jan 22, 2025 · 5 comments

Comments

@mickyfazler
Copy link

After upgrading React Native from version 0.76.6 to 0.77, my Android build fails with Kotlin compilation errors. The errors appear to originate from dependencies react-native-menu_menu and @shopify/flash-list.

To Reproduce:

  1. Upgrade React Native to 0.77
  2. Run npx react-native run-android

Expected behavior:

The Android app should build and install successfully.

Screenshots/Error Logs:

> Task :react-native-menu_menu:compileDebugKotlin FAILED                                                           

> Task :shopify_flash-list:compileDebugKotlin
w: file:///C:/Users/User/Downloads/.o/projectX/node_modules/@shopify/flash-list/android/src/main/kotlin/com/shopify/reactnative/flash_list/AutoLayoutView.kt:16:8 'interface RCTEventEmitter : Any, JavaScriptModule' is deprecated. Deprecated in Java.
w: file:///C:/Users/User/Downloads/.o/projectX/node_modules/@shopify/flash-list/android/src/main/kotlin/com/shopify/reactnative/flash_list/BlankAreaEvent.kt:22:18 This declaration overrides a deprecated member but is not marked as deprecated itself. Please add the '@Deprecated' annotation or suppress the diagnostic.
345 actionable tasks: 11 executed, 334 up-to-date

info 💡 Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor 

Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
e: file:///C:/Users/User/Downloads/.o/projectX/node_modules/@react-native-menu/menu/android/src/main/java/com/reactnativemenu/MenuView.kt:56:3 'onInterceptTouchEvent' overrides nothing.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-menu_menu:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
   > Compilation error. See log for more details

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 4s
error Failed to install the app. Command failed with exit code 1: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. e: file:///C:/Users/User/Downloads/.o/projectX/node_modules/@react-native-menu/menu/android/src/main/java/com/reactnativemenu/MenuView.kt:56:3 'onInterceptTouchEvent' overrides nothing. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':react-native-menu_menu:compileDebugKotlin'. > A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction > Compilation error. See log for more details * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. > Get more help at https://help.gradle.org. BUILD FAILED in 4s.
info Run CLI with --verbose flag for more details.

Environment:

  • React Native version: 0.77
  • Platform: Android
  • react-native-menu version: 1.2.1

Image

Thank you for such an amazing library! 💓🙏🫡

@TheAdamBorek
Copy link

+1

I'm also getting android compiling issues with RN 0.77

@edwinkcw
Copy link

+1

@TrustyTechSG
Copy link

Im also having this issue. any walkaround at the moment?

@quocluongha
Copy link

quocluongha commented Jan 24, 2025

It seems the React Native team updated the onInterceptTouchEvent method declaration in class ReactViewGroup here.

Here is the patch that should fix the problem.
@react-native-menu+menu+1.2.1.patch

There is a PR #1022 for this issue and it has been merged.

@mickyfazler
Copy link
Author

💓Just wanted to confirm that PR #1022 completely solved this issue! Thanks to @compojoom for the fix, and to @quocluongha for sharing the .patch file that helped get it resolved!

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

No branches or pull requests

5 participants