votrai123 / integrate-multiple-react-native

8 stars 4 forks source link

Cannot run mini app due to some libs #10

Closed hookie256 closed 7 months ago

hookie256 commented 7 months ago

I installed libs in both superapp and miniapp: react-native-gesture-handler and react-native-safe-area-context. When I opened miniapp, this error appear only in Android:

[react-native-gesture-handler] react-native-gesture-handler module was not found. Make sure you're running your app on the native platform and your code is linked properly (cd ios && pod install && cd ..).

Invariant Violation: requireNativeComponent: "RNCSafeAreaProvider" was not found in the UIManager. This error is located at: in RNCSafeAreaProvider in Unknown in Unknown in RCTView in Unknown in RCTView in Unknown in f, js engine: hermes

hookie256 commented 7 months ago

This error appears when app cannot find native module in android, why? and do you have any help?

votrai123 commented 7 months ago

Are you sure you did the same steps https://github.com/votrai123/integrate-multiple-react-native/issues/1#issuecomment-1801081984

votrai123 commented 7 months ago

For React Native 0.61 or greater, add the library as the first import in your index.js file:

import 'react-native-gesture-handler';

Are you add this?

hookie256 commented 7 months ago

With some libs like https://www.npmjs.com/package/bip39, this only contain js code, it appears an error: "Native module not found" when I call bip39.generateMnemonic() I found no native code here, so what can I do to solve this?

hookie256 commented 7 months ago

Have you got any idea about this? @votrai123

votrai123 commented 7 months ago

For libraries with only JS code, you just need to install them for all apps. It doesn't require linking the package to the parent native app. The library you sent me doesn't use the native language. Maybe there's an issue with another library. @hookie256

hookie256 commented 7 months ago

this error only appears in android and with all js lib

votrai123 commented 7 months ago

Try deleting this library. Does the error still occur?

hookie256 commented 7 months ago

If I deleting, that error does not appear...but I have to remove my code =((( @votrai123 when this code bip39. generateMnemonic() run, error appears. it doesn't appear when opening app