[@RNC/AsyncStorage]: NativeModule: AsyncStorage is null.
See original GitHub issueHello Guys, am new to react native i just facing a new problem which i cannot understand what and why its happening ? any one help me with this, I was just try to use AsyncStorage for local storage and its just working fine when i import the AsyncStorage from react-native like : import { AsyncStorage } from ‘react-native’; (its working fine )
But when i try to use by import the AsyncStorage from @react-native-community/async-storage like :
import AsyncStorage from ‘@react-native-community/async-storage’;
it produce error like :
[@RNC/AsyncStorage]: NativeModule: AsyncStorage is null.
To fix this issue try these steps:
• Run react-native link @react-native-community/async-storage
in the project root.
• Rebuild and restart the app.
• Run the packager with --clearCache
flag.
• If you are using CocoaPods on iOS, run pod install
in the ios
directory and then rebuild and re-run the app.
Why it is Happning with this import ? and I forget to tell that I also run the link command as
react-native link @react-native-community/async-storage after installing Still not working why ?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:67 (20 by maintainers)
Top GitHub Comments
Hey @santhanakrishnanstark
Looks like you forgot to re-compile your app with
react-native run-android
orreact-native run-ios
(dependending on your target platform).Let me know if that helped.
thanks.
@IvanFMt
If you’re using
expo
, you cannot add this package. Use whateverexpo
gives you (and ignore the warning about deprecation).