async-storage: Error: [@RNC/AsyncStorage]: NativeModule: AsyncStorage is null.
Proposal
To fix this issue try these steps:
• Rebuild and restart the app.
• Run the packager with --reset-cache
flag.
• If you are using CocoaPods on iOS, run pod install
in the ios
directory and then rebuild and re-run the app.
• If this happens while testing with Jest, check out docs how to integrate AsyncStorage with it: https://react-native-async-storage.github.io/async-storage/docs/advanced/jest I tried all these things but can’t able to solve this plz provide some solution if some one knows any solution
Alternatives
No response
Implementation Details
No response
Additional Context
No response
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 1
- Comments: 28 (3 by maintainers)
I’m facing this same issue on the emulator while creating a build, but it works if I’m on development mode. I’m using expo, and eas-cli to create the build.
Yeah, I find this, it is a temporary solution. I try to kill every app installed on the simulator before and reinstall the app, and then it works!
I don’t know if Expo autolinks native modules the same way vanilla React Native does, but assuming it does, you need to explicitly take dependency on AsyncStorage if any of your dependencies need it. Autolinking only links native modules that are found in the current project’s
package.json
.Facing the same issue right now.
I get this when trying running my app on a expo custom development build.
Actually I have found the solution: