React-native,“原生模块不能为空"; [英] React-native, "Native module cannot be null"

查看:36
本文介绍了React-native,“原生模块不能为空";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是将 React-native 从 0.28 升级到 0.30,并得到这个错误:

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

本机模块不能为空".

问题似乎出在线路/包上:

The problem seem to be with the line/package:

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

推荐答案

红框投诉 react-native cannot find some symbol in PushNotificationIOS.js line 18.

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

这通常发生在您无法将第三个库链接到目标时,导致 NativeModules 在尝试时一无所获.

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

为了解决这个问题,你的项目导航器 -> 目标 -> 通用 -> 链接框架和库,确保 somelib.a 存在.

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

在您的情况下,请遵循 ios 安装指南react-native 文档

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

这篇关于React-native,“原生模块不能为空";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆