React native unable to build

I’m currently making an expo/react-native project, which uses react navigation, redux and firebase, and other dependencies, at some point of developing there was a conflict with peer dependencies that broke my entire application and could no longer start due to this issue:

ERROR Invariant Violation: AsyncStorage has been removed from react-native core. It can now be installed and imported from ‘@react-native-async-storage/async-storage’ instead of ‘react-native’. See GitHub - react-native-async-storage/async-storage: An asynchronous, persistent, key-value storage system for React Native.

I tried removing, updating and downgrading some dependencies and installing them one by one but I have not found a clear root of this problem.
I use npm install --legay-peer-deps command as advised when I looked for answers before and it is still like this.

This is my current package.json:

"dependencies": {
    "@react-navigation/bottom-tabs": "^6.5.8",
    "@react-navigation/native": "^6.1.7",
    "@react-navigation/native-stack": "^6.9.13",
    "@reduxjs/toolkit": "^1.9.5",
    "expo": "^47.0.0",
    "firebase": "^8.6.8",
    "native-base": "^3.4.28",
    "react": "^18.2.0",
    "react-native": "^0.72.0",
    "react-native-gesture-handler": "~2.8.0",
    "react-native-safe-area-context": "4.4.1",
    "react-native-screens": "~3.18.0",
    "react-native-svg": "13.4.0",
    "react-redux": "^8.1.1",
    "redux": "^4.2.1",
    "redux-thunk": "^2.4.2"

To clarify I do NOT use the AsyncStorage in my application, at least not directly, it may be the case that some module uses it without my knowledge.

The second problem that arised is this:

None of these files exist:
15 | import typeof ActivityIndicator from ‘./Libraries/Components/ActivityIndicator/ActivityIndicator’;
16 | import typeof Button from ‘./Libraries/Components/Button’;
17 | import typeof DrawerLayoutAndroid from ‘./Libraries/Components/DrawerAndroid/DrawerLayoutAndroid’;

Then again I do not directly use this or have knowledge of any module using it.

If someone could give me a guidance to why this happens and how to solve it, it will be much appreciated.

Please ask for more information related whenever you need to better work on this problem together.

This is the first mobile app I make and any insightful advice related to this issue or to react-native will be immensely helpful.

Did you install the dependency as suggested? Just because you are not using it doesn’t mean one of your packages isn’t.

You can check what packages depend on a package.

packages depending on @react-native-async-storage/async-storage

1 Like

Wow you saved me, it was actually the firebase/auth using it so I could look into that and found this:
firebase async storage thread
and it happens that my firebase was outdated, now after reading the thread I configured it correctly, updated and problem solved, thank you so much!!!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.