roam-reactnative icon indicating copy to clipboard operation
roam-reactnative copied to clipboard

NativeModules.RNRoam is undefined

Open xNilsson opened this issue 3 years ago • 4 comments

Hi! 👋

We're eager to try out roam for our app. We followed the instructions for installing with autolinking. Importing roam-reactnative' works fine, but as soon as we try to use call a method on Roamwe get:NativeModules.RNRoam is undefined`. We've tried both on simulator and device.

One theory could be that we had the bundle-id for production, but when we run debug we have another bundle-id. Couldn't get it to work anyway though.

We are using:

React-native: 0.66.3
React: 17.0.2
iOS device & simulator
2022-06-21 11:38:05.167630+0200 Vembla[43965:3377170] [javascript] 'Error: Requiring module "../hooks/useRoam.ts", which threw an exception: Error: NativeModules.RNRoam is undefined',

xNilsson avatar Jun 21 '22 09:06 xNilsson

Hi! 👋

We're eager to try out roam for our app. We followed the instructions for installing with autolinking. Importing roam-reactnative' works fine, but as soon as we try to use call a method on Roamwe get:NativeModules.RNRoam is undefined`. We've tried both on simulator and device.

One theory could be that we had the bundle-id for production, but when we run debug we have another bundle-id. Couldn't get it to work anyway though.

We are using:

React-native: 0.66.3
React: 17.0.2
iOS device & simulator
2022-06-21 11:38:05.167630+0200 Vembla[43965:3377170] [javascript] 'Error: Requiring module "../hooks/useRoam.ts", which threw an exception: Error: NativeModules.RNRoam is undefined',

Hey @cNille ,

It seems like the auto linking did not work. Can you try the manual linking as per the steps below.

Manual Linking

  • Open the iOS module files, located inside node_modules/roam-reactnative/ios/.
  • Open the app workspace file (AppName.xcworkspace) in Xcode.
  • Move the RNRoam.h and RNRoam.m files to your project. When shown a popup window, select Create groups.

Let us know if that solved the issue.

Thanks.

jothipriyadharshanr avatar Jun 21 '22 10:06 jothipriyadharshanr

Hi @jothipriyadharshanr ,

Thanks for the quick reply! The steps you described worked, thanks! 🙏

Though we now would need a script to do this manually on installation as our ios-folder is gitignored as it's auto generated by react-native. Will this be fixed with upcoming release?

xNilsson avatar Jun 21 '22 12:06 xNilsson

Hi @jothipriyadharshanr ,

Thanks for the quick reply! The steps you described worked, thanks! 🙏

Though we now would need a script to do this manually on installation as our ios-folder is gitignored as it's auto generated by react-native. Will this be fixed with upcoming release?

Our team is looking into this behaviour and this will be addressed in the upcoming release. We will keep this issue open and update link this to our respective release.

jothipriyadharshanr avatar Jun 21 '22 12:06 jothipriyadharshanr

Hey @cNille ,

It seems like the auto linking did not work. Can you try the manual linking as per the steps below.

Manual Linking

  • Open the iOS module files, located inside node_modules/roam-reactnative/ios/.
  • Open the app workspace file (AppName.xcworkspace) in Xcode.
  • Move the RNRoam.h and RNRoam.m files to your project. When shown a popup window, select Create groups.

Let us know if that solved the issue.

Thanks.

The same issue is coming on android. Can you please reply ASAP. Stuck

manasgond avatar Sep 15 '22 10:09 manasgond