I was trying to Upgrade my Expo SDK 46 to 48 - following the steps on Midium- https://blog.expo.dev/expo-sdk-48-ccb8302e231 but after following the upgrading commands, I started getting ERROR Invariant Violation: AsyncStorage has been removed from react-native core
Does anyone know how to fix this Error? Thank you for your help in advance.
enter image description here
This is the Error message that I am getting.
As mentioned by Naveed above in comment. You most likely have an import in one of your js/ts files causing the error since AsyncStorage is no longer in React-Native.
This import is wrong:
import { AsyncStorage } from 'react-native'
Make sure you have @react-native-async-storage/async-storage installed by following instructions here: https://react-native-async-storage.github.io/async-storage/docs/install/
Then change all imports from:
import { AsyncStorage } from 'react-native'
to
import AsyncStorage from '@react-native-async-storage/async-storage'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With