Encountered an same erron in my React Native project. After troubleshooting, I found a solution that resolved the problem. Here’s a step-by-step guide to fix it.
Step-by-Step Fix
Or, if using Yarn:
yarn add @react-native-async-storage/async-storage
npx react-native start --reset-cache npx react-native run-android # For Android
Check for Linking React Native should automatically link the package. However, if I needed to manually link it, I used: npx react-native link @react-native-async-storage/async-storage
Manually Rebuild for Android
For Android, I ensured a clean build by running:
cd android
./gradlew clean
cd ..
npx react-native run-android
After making these changes, my AsyncStorage
implementation worked correctly.