Error: [@RNC/AsyncStorage]: NativeModule: AsyncStorage is null.
pulkitk702 opened this issue · 28 comments
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
I have the same issue on a completely naked app. Very frustrating
We'll need more details than that to help. Repro steps or steps that you have tried to resolve it
Actually I have found the solution:
- Wipe data from your Emulator or set a new device
- Then try to rebuild the App
And by doing this it worked on me .
Close app on emulator and run "react-native run-android" or "react-native run-ios". Worked for me.
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.
Facing the same issue right now.
I get this when trying running my app on a expo custom development build.
Like @DaatKruby I'm using eas build and am getting this issue when I open my app after installing it from an APK file. I'm using version 1.19.1 of @react-native-async-storage/async-storage. I wonder if moving to an older version will help...
I'm having the same error on expo only when I use firebase auth.
"firebase": "^10.1.0",
Any suggestions?
Hey @ahmadkarkouti I'm facing same issue. Have you found any solution for it?
@willpiam i didn't used AsyncStorage anywhere in my app it is coming from Firebase
My solution was to create a new expo project and add my existing files there (excluding package.json, app.json, metro.config.js, etc). Everything new except for the actual code
I couldn't find how to fix the issue on my current project
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
.
finally this resolved my issue " npx expo install @react-native-async-storage/async-storage " 🥲.
I don't use Expo, I use RN CLI, is there any way to link manually?
{"react-native": "0.72.4",}
I don't use Expo, I use RN CLI, is there any way to link manually?
{"react-native": "0.72.4",}
What I said here applies to RN CLI: #994 (comment)
That so weird, I didn't change anything, after recreating the project and migrated the project over, it was solved. That is really weird, but I still want to know why this happens
If you are using Expo packages in your bare React Native project, you need to update expo package to version 49 for React Native 0.72.
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
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'm currently considering alternative libraries. It's a shame because this one works very well until you need to build.
Hi
Did you find any good alternatives? I'm facing the same issue and I've tried everything to fix it but it keeps happening whenever I try to build.
I'm currently considering alternative libraries. It's a shame because this one works very well until you need to build.
Hi
Did you find any good alternatives? I'm facing the same issue and I've tried everything to fix it but it keeps happening whenever I try to build.
npx expo install @react-native-async-storage/async-storage
Try this
I'm currently considering alternative libraries. It's a shame because this one works very well until you need to build.
Hi
Did you find any good alternatives? I'm facing the same issue and I've tried everything to fix it but it keeps happening whenever I try to build.npx expo install @react-native-async-storage/async-storage
Try this
I'm using React Native CLI
Using the very latest version of expo (and RN 0.72) none of these workaround fix this.
@tido64 i try this npx expo install @react-native-async-storage/async-storage but still facing issue
For people who use react-native-web, my problem was the babel plugin of react-native-web that I had put in the babel.config.js. Removing it solved my problem.
Remove this in babel.config.js
[
'react-native-web',
{
commonjs : true,
},
]
And put it instead in the webpack configuration => webpack.config.js
This issue has been marked as stale due to inactivity. Please respond or otherwise resolve the issue within 7 days or it will be closed.