react-native
react-native copied to clipboard
Unable to parse @ReactMethod annotations from native module
Description
Hello New Arch friends!!
After upgrading to React Native 74/bridgeless from 73 (already was using the new arch), I'm receiving the following issue:
0.74.2: 2024-06-26 13:58:22.563 16714-16799 ReactNativeJS com.omniafishing.app
E Error: Exception in HostObject::get for prop 'RNIterableAPI':
com.facebook.react.internal.turbomodule.core.TurboModuleInteropUtils$ParsingException:
Unable to parse @ReactMethod annotations from native module: RNIterableAPI.
Details: Module exports two methods to JavaScript with the same name: "setUserId"
The error makes sense, there are two instances of setUserId
in the RNIterableAPI package - they're method overloads. I guess it also makes sense javascript doesn't support overloading.
What I don't understand is why this error started popping up now. I ran across this thread where two other people were experiencing the same issue with different packages than me - otherwise I'd continue to assume that I have some sort of configuration or caching issue. That could, of course, still be the case.
Update: It's probably the case. My reproducer demo shows that react native 0.74.2 is in fact working with Iterable. I'm filing this anyway in case anyone else finds their way here in search of help. To everyone supporting react-native, though, feel free to close this. I don't know where to go from here, but I'll report back if I resolve the issue.
Steps to reproduce
- Bootstrap a react native project using 0.74.2 and the new arch / bridgeless
- Install
"@iterable/react-native-sdk": "1.3.19"
- Build Android
- Try to run Android
- It works, what is this kid talking about?
React Native Version
0.74.2
Affected Platforms
Runtime - Android
Areas
Bridgeless - The New Initialization Flow
Output of npx react-native info
System:
OS: macOS 14.1.2
CPU: (10) arm64 Apple M1 Pro
Memory: 66.84 MB / 32.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 18.20.3
path: ~/.nvm/versions/node/v18.20.3/bin/node
Yarn:
version: 3.6.4
path: ~/.nvm/versions/node/v18.20.3/bin/yarn
npm:
version: 10.7.0
path: ~/.nvm/versions/node/v18.20.3/bin/npm
Watchman:
version: 2023.12.04.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.14.3
path: /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.5
- iOS 17.5
- macOS 14.5
- tvOS 17.5
- visionOS 1.2
- watchOS 10.5
Android SDK:
Android NDK: 22.1.7171670
IDEs:
Android Studio: 2023.1 AI-231.9392.1.2311.11330709
Xcode:
version: 15.4/15F31d
path: /usr/bin/xcodebuild
Languages:
Java:
version: 18.0.2
path: /usr/bin/javac
Ruby:
version: 2.6.10
path: /usr/bin/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.74.2
wanted: 0.74.2
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: true
newArchEnabled: false // not related to the bug, but not sure why this is false
Stacktrace or Logs
E Error: Exception in HostObject::get for prop 'RNIterableAPI': com.facebook.react.internal.turbomodule.core.TurboModuleInteropUtils$ParsingException: Unable to parse @ReactMethod annotations from native module: RNIterableAPI. Details: Module exports two methods to JavaScript with the same name: "setUserId
2024-06-26 14:50:39.017 11801-11944 Compatibil...geReporter com.omniafishing.app D Compat change id reported: 289878283; UID 10500; state: ENABLED
2024-06-26 14:50:39.027 11801-11944 ReactNativeJS com.omniafishing.app I Running "main" with {"rootTag":11,"initialProps":{},"fabric":true}
2024-06-26 14:50:39.028 11801-11944 ReactNativeJS com.omniafishing.app E Invariant Violation: "main" has not been registered. This can happen if:
* Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called.
2024-06-26 14:50:39.035 11801-12056 TrafficStats com.omniafishing.app D tagSocket(172) with statsTag=0xffffffff, statsUid=-1
2024-06-26 14:50:39.309 11801-12057 ProfileInstaller com.omniafishing.app D Installing profile for com.omniafishing.app
Reproducer
https://github.com/connorpmullins/breakIterable
Screenshots and Videos
No response