问题
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