Skip to content

Native module cannot be null (blast from the past) #460

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

Closed
ferologics opened this issue Feb 23, 2017 · 11 comments
Closed

Native module cannot be null (blast from the past) #460

ferologics opened this issue Feb 23, 2017 · 11 comments

Comments

@ferologics
Copy link

I wrap already working component in the simplest way

const Demos = StackNavigator({
  Home: { screen: DemoList }
})

I AppRegistry.registerComponent('Demos', () => Demos). Voilà:

error - Native module cannot be null.

If I AppRegistry.registerComponent('DemoList', () => DemoList) everything works like a charm.

It's a hybrid app with Cocoapods / RN / Obj-C. The registered component is being initialized as RCTRootView module, later presented as a ViewController in native.

@ferologics
Copy link
Author

ferologics commented Feb 23, 2017

In fact, just mentioning StackNavigator gives me the error, unrelated to component registry. Must be something off with project structure, just can't figure out what it is.

EDIT: Tried using react-native-router-flux with the same outcome. Confirming that it's definitely on my end. Probably the bridge is not ready for the NativeEventEmitter and it's failing.

@ferologics
Copy link
Author

I was missing the RCTLinkingIOS pod subspec inside my Podfile. All good here 💯

@mariobento
Copy link

mariobento commented Mar 7, 2017

mehh had to search on the issues to find this ... maybe it is a good ideia do add a "How to integrate with hybrid app" section on the docs! 👍

@ferologics
Copy link
Author

@mariobento In my past week experience the majority of solutions were from, as you say searching on issues, and reading the source. The project is very fresh but slowly getting there.

@vinayakparmar92
Copy link

vinayakparmar92 commented Mar 27, 2017

@ferologics Tried adding RCTLinkingIOS to podspec. Still getting the same error. Any solution for this issue?

@bithavoc
Copy link

@vinayakparmar92 my node.js was too old(4.x), upgraded to 7.x and started working.

@shrutic
Copy link

shrutic commented May 9, 2017

Adding RCTLinkingIOS to podspec causes the compilation of React native code to fail as I am using it inside an iMessage extension and using [RCTSharedApplication() openUrl: URL] fails with the error

"..native/Libraries/LinkingIOS/RCTLinkingManager.m:74:41: 'openURL:' is unavailable: not available on iOS (App Extension)"

Anyone easy way to resolve this barring changing the react native code ?

@shrutic123
Copy link

facebook/react-native#13881 is a PR that fixes this issue. Adding it here so that hopefully it might get some eyes so that it can be checked in. I have the fix out for over 10 days with signed off CI tests, but no one at react-native is looking into it. :(

@louisiscoding
Copy link

louisiscoding commented Oct 12, 2017

I've tried to add React Navigation to my Hybrid RN/Swift Project and i've still had this issue

Using:

"react": "^15.4.1",
"react-native": "0.42.x",
"react-navigation": "^1.0.0-beta.13",
"react-redux": "^5.0.6",
"redux": "^3.7.2",
"redux-form": "^6.8.0"

Thanks @ferologics 💯

@bill-mark
Copy link

i meet the same issue when i tye use react-navigation in an existing app,please for help

@mailworks
Copy link

mailworks commented Jan 25, 2018

i meet the same issue too
"axios": "^0.17.1",
"prop-types": "^15.6.0",
"pubsub-js": "^1.6.0",
"qs": "^6.5.1",
"react": "16.2.0",
"react-native": "0.51.0",
"react-native-config": "^0.11.5",
"react-native-loading-spinner-overlay": "^0.5.2",
"react-native-material-design-searchbar": "^1.8.0",
"react-native-root-toast": "^3.0.0",
"react-native-sqlite-storage": "^3.3.4",
"react-native-vector-icons": "^4.5.0",
"react-navigation": "^1.0.0-beta.27",
"react-redux": "^5.0.6",
"redux": "^3.7.2",
"redux-form": "^7.2.0",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.2.0"

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

9 participants