React-native, "Native module cannot be null"

I just upgrade React-native from 0.28 to 0.30, and get this error:

"Native module cannot be null".

The problem seem to be with the line/package:

var PushNotification = require('react-native-push-notification');

Screenshot


The red-box complaints react-native cannot find some symbol <unkown> in PushNotificationIOS.js line 18.

This usually happens when you fail to link the third lib to your target causing NativeModules find nothing at attempt.

To solve this, your Project Navigator -> Target -> General -> Linked Frameworks and Libraries, make sure somelib.a is there.

enter image description here

In your case, please follow the ios install guides and react-native doc


Sometime, if you had another react-native packager already running for a different app. You may see this problem.

Especially if the react-native versions are same and the previously started app requires a native module which is not available in the current app.

In these cases, you can kill the react packager terminal and restart it and problem should go away.

Also if it is the same app and you just upgraded. Make sure that it is linked properly. If not call react-native link again.


In my case, running a $ pod install inside /ios directory did the trick!


I think this has to do with how to export and import your modules. Make sure each corresponding

If you export your module like this module.exports = moduleName; You should import using var moduleName = require('moduleName');

If export your module using export default moduleName;. You should import using import ModuleName from './ModuleName;

Review all your exports and imports.