EXPO Error: [@RNC/AsyncStorage]: NativeModule: AsyncStorage is null.

See original GitHub issue

What happened?

Hi, I use expo to build my app, I just recently upgrade from SDK 38 to SDK 41, I looked at the depreciations… But I keep getting this error

`Error: [@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 --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-community.github.io/async-storage/docs/advanced/jest

If none of these fix the issue, please open an issue on the Github repository: https://github.com/react-native-community/react-native-async-storage/issues

Invariant Violation: “main” has not been registered. This can happen if:

Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project. A module failed to load due to an error and AppRegistry.registerComponent wasn’t called.` I tried customizing metro.config.js (I created this file as I didn’t have it before and tried to tweak it with response I say), But I noticed that my expo actually came with babel.config.js (I don’t know if that’s a problem). I have tried all the tweak I saw and its not working still. Please I need urgent help as I have a deadline.

Version

1.13.0

What platforms are you seeing this issue on?

  • Android
  • iOS
  • macOS
  • Windows
  • web

System Information

System:
    OS: Windows 10 10.0.16299
    CPU: (4) x64 Intel(R) Core(TM) i3-5010U CPU @ 2.10GHz
    Memory: 1.96 GB / 7.88 GB
  Binaries:
    Node: 16.13.0 - C:\Program Files\nodejs\node.EXE
    Yarn: Not Found
    npm: 8.1.3 - ~\AppData\Roaming\npm\npm.CMD
    Watchman: Not Found
  SDKs:
    Android SDK: Not Found
    Windows SDK:
      AllowAllTrustedApps: Enabled
      Versions: 10.0.18362.0
  IDEs:
    Android Studio: Version  4.1.0.0 AI-201.8743.12.41.6953283
    Visual Studio: 16.6.30204.135 (Visual Studio Community 2019)
  Languages:
    Java: 15.0.1 - C:\Program Files\Java\jdk-15.0.1\bin\javac.EXE
    Python: 3.10.0 - C:\Python310\python.EXE
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.1 => 17.0.1
    react-native: ^0.63.4 => 0.63.4
    react-native-windows: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Steps to Reproduce

  1. Upgrade EXPO from 39 to 41

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

2reactions
codaDevDancommented, Dec 19, 2021

We use aws-amplify for our auth, which depends on @react-native-community/async-storage. However, we get this error if we install @react-native-community/async-storage. Is there any way to use the library in a managed project? We’d really prefer not to eject or have to change auth providers.

1reaction
milon27commented, Dec 19, 2021
  • delete everything from node_modules
  • delete the package-lock.json file
  • clear all data/cache from expo go app.
  • use “@react-native-async-storage/async-storage”: “1.15.0” this exact version
  • npm install agin.
  • npm run android

i solved the issue this way. you can also try

Read more comments on GitHub >

github_iconTop Results From Across the Web

react native - NativeModule: AsyncStorage is null, with @RNC ...
This error can be rectified by linking the module like mentioned above but linking does not work if your app is Expo Managed...
Read more >
NativeModule: AsyncStorage is null · Issue #768 - GitHub
Error: [@RNC/AsyncStorage]: NativeModule: AsyncStorage is null. To fix this issue try these steps: • Rebuild and restart the app.
Read more >
ERROR Error: [@RNC/AsyncStorage]: NativeModule - Medium
ERROR Error : [@RNC/AsyncStorage]: NativeModule: AsyncStorage is null. Rebuild and restart the app. Run the packager with '--reset-cache' flag.
Read more >
NativeModule: AsyncStorage is null EXPO EAS app - Reddit
i am having this issue for a while. To fix this issue try these steps: • Rebuild and restart the app. • Run...
Read more >
Error ReactNative AsyncStorage is null iOS-React Native
target 'YourApp' do #The line below pod 'RNCAsyncStorage', :path => '../node_modules/@react-native-community/async-storage' target 'YourAppTests' do inherit ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found