question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invariant Violation: Native module cannot be null.

See original GitHub issue

I have tried the example code wont work I tried to import PushNotification from 'react-native-push-notification'; Wont work I installed npm i @react-native-community/push-notification-ios and still wont work any help ?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:6

github_iconTop GitHub Comments

19reactions
gie3dcommented, Feb 4, 2020

I also had the same issue and this is what I did to solve:

  1. @react-native-community/push-notification-ios has already been installed as a dependency of react-native-push-notification. So you do not need to install it separately
  2. Update your podfile by adding this pod 'RNCPushNotificationIOS', :path => '../node_modules/@react-native-community/push-notification-ios'
  3. Run pod install in the ios folder
  4. In your AppDelegate.m, update this https://github.com/react-native-community/react-native-push-notification-ios#update-appdelegatem
2reactions
Return-1commented, Mar 13, 2020

i am also experiencing this. the above solutions dont seem to work : /

Read more comments on GitHub >

github_iconTop Results From Across the Web

Invariant Violation: Native module cannot be null #43 - GitHub
At iOS, it builds successfully, however, when the app starts, I get this error: Invariant Violation: Native module cannot be null.
Read more >
(React Native - Invariant Violation: Native module cannot be null
This module (aws-amplify@unstable) introduced an error saying TypeError: undefined is not an object (evaluating '_core.Amplify.register') so ...
Read more >
Invariant Violation: Native module cannot be null. on Managed ...
SDK Version: 41.0.0; Platforms(Android/iOS/web/all): Android/ios. I upgraded to SDK 41 yesterday and worked out some smaller issues before ...
Read more >
" has not been registered" and "Invariant Violation: Native ...
I am working on a project in React Native using Expo and Firebase. ... and "Invariant Violation: Native module cannot be null" errors ......
Read more >
Error Running mobile-preview "Invariant Violation: Native ...
Hello, trying to setup the mobile-preview app for component dev. Just trying to run the app in Xcode at this point, not loading...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found