错误 ReactNative AsyncStorage is null iOS [英] Error ReactNative AsyncStorage is null iOS

查看:62
本文介绍了错误 ReactNative AsyncStorage is null iOS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 asyncStorage 使用 ReactNative 开发一个应用程序,在 Android 上它运行良好,我在 iOS 上有问题,我无法解决问题:错误:[@RNC/AsyncStorage]:NativeModule:AsyncStorage 为空.

I am developing an app with ReactNative using asyncStorage, on Android it is working fine, I have the problem on iOS, I can't solve the problem: Error: [@ RNC / AsyncStorage]: NativeModule: AsyncStorage is null.

这是错误的图片

我已经尝试了您在错误消息中放置的所有说明,但我已经查找了相同的错误,但找不到解决方案.看看有没有人遇到过这个错误,可以帮帮我,非常感谢.

I've tried all the instructions you put in the error message, and I've looked for the same error and can't find the solution. Let's see if anyone has had the same experience with this error and can help me, thank you very much.

更多信息:

  • 我没有使用世博会
  • React Native 版本 61.5

推荐答案

尝试在您的 ios/Podfile 中添加以下行:

Try adding the following line on your ios/Podfile:

[...]
target 'YourApp' do
  #The line below
  pod 'RNCAsyncStorage', :path => '../node_modules/@react-native-community/async-storage'
  
  target 'YourAppTests' do
    inherit! :complete
    # Pods for testing
  end
[...]

然后 cd ios &&pod安装

确保你已经安装了 cocoapods 并且你在你的项目中使用了 pods.

Make sure you have cocoapods installed and you're using pods on your project.

这篇关于错误 ReactNative AsyncStorage is null iOS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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