react-native - 不变违规 : Native module cannot be null

标签 react-native expo

您好,我在尝试安装和导入 expo-notifications 时遇到错误。我遵循了此处的文档:https://docs.expo.io/versions/v38.0.0/sdk/notifications/并运行 expo install expo-notifications 但是当我尝试导入它时收到此错误。我知道错误来自此导入,因为当我将其注释掉时,我的应用程序正常加载。我正在使用世博会管理的工作流程。感谢是否有人可以帮助我解决这个问题!编辑:在 Android 模拟器上对其进行了测试,它在那里工作,所以这似乎是一个 IOS 问题。

enter image description here

enter image description here

最佳答案

设法通过运行 expo upgrade 从 expo sdk 37 升级到 expo sdk 38 使其工作

关于react-native - 不变违规 : Native module cannot be null,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62581334/

相关文章:

javascript - React Native 底部选项卡导航不起作用

ios - 在 React Native 中居中 PickerIOS

react-native - 我可以在平面列表中使用 ItemSeparatorComponent 中的组件吗?

reactjs - React Native 获取 Flatlist 索引

javascript - 使用expo Camera SDK时,Undefined不是一个对象_expo.camera.constant

javascript - 即使使用 extraData={this.state},PureComponent FlatList 也不会重新渲染

expo - 无法连接到 TCP 端口 : Connection refused when trying to open Expo app on Android Emulator in WSL2

javascript - React-Native:警告:无法对未安装的组件执行 React 状态更新

javascript - "react-native link"到底是做什么的?

android - React native Expo 版本代码 1 已被使用。尝试其他版本代码