Error ReactNative AsyncStorage is null iOS

我是研究僧i 提交于 2021-01-29 17:52:15

问题


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.

Here is a picture of the error

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.

More information:

  • I'm not using expo
  • React Native version 61.5

回答1:


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
[...]

then cd ios && pod install

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



来源:https://stackoverflow.com/questions/63493043/error-reactnative-asyncstorage-is-null-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!