alinz / react-native-share-extension

react-native as an engine to drive share extension
MIT License
762 stars 396 forks source link

Follow the whole instructions and triple check, but still not working #136

Closed leiz-me closed 5 years ago

leiz-me commented 5 years ago

I hate to open a new issue asking about this question, but got no idea right now.

I am developing a share extention for my app and can't make it work. Just keep getting these error messages.

2019-01-04 11:39:19.931 [error][tid:com.facebook.react.JavaScript] Native module cannot be null.
2019-01-04 11:39:19.930856+0800 O2ShareExtention[41778:2714130] Native module cannot be null.
2019-01-04 11:39:19.938 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: Native module cannot be null.
2019-01-04 11:39:19.938015+0800 O2ShareExtention[41778:2714126] Unhandled JS Exception: Native module cannot be null.
2019-01-04 11:39:19.948 [error][tid:com.facebook.react.JavaScript] Module AppRegistry is not a registered callable module (calling runApplication)
2019-01-04 11:39:19.948537+0800 O2ShareExtention[41778:2714130] Module AppRegistry is not a registered callable module (calling runApplication)

And this is my system setup

React Native Environment Info:
    System:
      OS: macOS High Sierra 10.13.6
      CPU: (4) x64 Intel(R) Core(TM) i7-5650U CPU @ 2.20GHz
      Memory: 173.09 MB / 8.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 10.14.1 - ~/.nvm/versions/node/v10.14.1/bin/node
      Yarn: 1.12.3 - /usr/local/bin/yarn
      npm: 6.4.1 - ~/.nvm/versions/node/v10.14.1/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
      Android SDK:
        API Levels: 23, 24, 25, 26, 27, 28
        Build Tools: 23.0.1, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.2, 28.0.3
    IDEs:
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.6.1 => 16.6.1
      react-native: 0.57.7 => 0.57.7
    npmGlobalPackages:
      react-native-git-upgrade: 0.2.7
isaachinman commented 5 years ago

Well, did you check what it is that is null when it shouldn't be?

leiz-me commented 5 years ago

@isaachinman Could you give me some hint that how can I know what the Native module is? I got no experience of iOS native development, don't know how to debug that kind of info.

isaachinman commented 5 years ago

I would start by checking whatever O2ShareExtention is.

leiz-me commented 5 years ago

O2ShareExtention is the name of my app share extention, just like the MyShareEx of sample code.

isaachinman commented 5 years ago

Yes, I assumed so. You'll need to find out why it's null.

leiz-me commented 5 years ago

I found that my problem is similar to this issue #94 ,but got no idea why the extension app looks like not loading/accessing to the js bundle. The error message Module AppRegistry is not a registered callable module (calling runApplication) also indicates this, React Native Module is not loaded. This is currently what I have.

leiz-me commented 5 years ago

Well, finally I got it working. #48 did the trick. Thanks dude. @isaachinman

isaachinman commented 5 years ago

Ah great, glad to hear that.