首页 > 解决方案 > 错误:[@RNC/AsyncStorage]:NativeModule:AsyncStorage 为空

问题描述

错误:[@RNC/AsyncStorage]:NativeModule:AsyncStorage 为空。

要解决此问题,请尝试以下步骤:

react-native link @react-native-community/async-storage在项目根目录中运行。

• 重建并重新启动应用程序。

--reset-cache• 使用标志运行打包程序。

• 如果您在iOS 上使用CocoaPods,请pod installios目录中运行,然后重新构建并重新运行应用程序。

• 如果在使用 Jest 进行测试时发生这种情况,请查看如何将 AsyncStorage 与其集成的文档:https ://react-native-community.github.io/async-storage/docs/advanced/jest

如果这些都不能解决问题,请在 Github 存储库上打开一个问题:https ://github.com/react-native-community/react-native-async-storage/issues

标签: react-nativeasyncstorage

解决方案


推荐阅读