Roy Chan
Roy Chan

Reputation: 285

Invariant Violation: Native module cannot be null

Hi I have an error when I am trying to install and import expo-notifications. I followed the documentation here: https://docs.expo.io/versions/v38.0.0/sdk/notifications/ and ran expo install expo-notifications but I am receiving this error when I try to import it. I know the error comes from this import as when i comment it out, my app loads normally. I am using the expo managed workflow. Appreciate if anyone can help me with this issue! Edit: tested it on android simulator and it works there so this seems to be an IOS issue.

enter image description here

enter image description here

Upvotes: 3

Views: 9838

Answers (2)

Roy Chan
Roy Chan

Reputation: 285

Managed to get it working by upgrading from expo sdk 37 to expo sdk 38 by running expo upgrade

Upvotes: 4

fadzb
fadzb

Reputation: 459

Looks like there is an open issue on Github. Try this:

1.delete node_modules & package-lock.json

2.npm cache clean --force

3.npm install --save @react-native-community/push-notification-ios

https://github.com/react-native-community/push-notification-ios/issues/43#issuecomment-625020674

Upvotes: 0

Related Questions