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)

Most upvoted comments

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.

I ran into this issue again, but I found that the issue was that he compiled it twice on the simulator and ran two programs on the simulator at the same time. The second program would have this problem, but the first one would not. So you just need to select the home button to select the first program.

At least this is how I solved the problem. it’s just a option

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:

  1. Wipe data from your Emulator or set a new device
  2. Then try to rebuild the App And by doing this it worked on me .