SDK 48 breaks Firebase Auth

Please provide the following:

  1. SDK Version: 48
  2. Platforms(Android/iOS/web/all): iOS
  3. Add the appropriate “Tag” based on what Expo library you have a question on.

Since I upgraded my app to Expo 48, Firebase Auth does not work anymore. After each refresh of the app, the user has to log in again.

Same problem was asked by someone else here: react native - Expo SDK 48 broke Firebase Auth - Stack Overflow

"dependencies": {
    "@expo-google-fonts/poppins": "^0.1.0",
    "@expo/react-native-action-sheet": "^3.8.0",
    "@expo/vector-icons": "^13.0.0",
    "@gorhom/bottom-sheet": "^4",
    "@react-native-async-storage/async-storage": "1.17.11",
    "@react-navigation/native": "^6.0.8",
    "@react-navigation/native-stack": "^6.5.0",
    "@sentry/react-native": "4.9.0",
    "expo": "^48.0.0",
    "expo-apple-authentication": "~6.0.1",
    "expo-application": "~5.1.1",
    "expo-asset": "~8.9.0",
    "expo-av": "~13.2.1",
    "expo-blur": "~12.2.2",
    "expo-constants": "~14.2.1",
    "expo-crypto": "~12.2.1",
    "expo-device": "~5.2.1",
    "expo-font": "~11.1.1",
    "expo-haptics": "~12.2.1",
    "expo-linear-gradient": "~12.1.1",
    "expo-localization": "~14.1.1",
    "expo-notifications": "~0.18.1",
    "expo-speech": "~11.1.1",
    "expo-splash-screen": "~0.18.1",
    "expo-status-bar": "~1.4.4",
    "expo-updates": "~0.16.3",
    "expo-web-browser": "~12.1.1",
    "firebase": "^9.9.4",
    "hi-base32": "^0.5.1",
    "lodash": "^4.17.21",
    "moti": "^0.19.0",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-native": "0.71.3",
    "react-native-collapsible": "^1.5.3",
    "react-native-gesture-handler": "~2.9.0",
    "react-native-markdown-view": "^1.1.4",
    "react-native-reanimated": "~2.14.4",
    "react-native-root-siblings": "^4.1.1",
    "react-native-root-toast": "^3.4.0",
    "react-native-safe-area-context": "4.5.0",
    "react-native-screens": "~3.20.0",
    "react-native-svg": "13.4.0",
    "react-native-svg-flagkit-fixed-peer-dep": "^0.9.8",
    "react-native-switch-selector": "^2.0.6",
    "react-native-web": "~0.18.11",
    "react-redux": "^7.1.3",
    "reanimated-bottom-sheet": "^1.0.0-alpha.22",
    "redux": "^4.0.5",
    "redux-saga": "^1.1.3",
    "sentry-expo": "~6.0.0",
    "shorthash2": "^1.0.3",
    "use-memo-one": "^1.1.1"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@types/jest": "^25.1.3",
    "@types/lodash": "^4.14.169",
    "@types/node": "^13.7.0",
    "@types/react": "~18.0.27",
    "@types/react-dom": "~18.0.10",
    "@types/react-native": "~0.70.6",
    "@types/react-redux": "^7.1.9",
    "@types/text-encoding": "^0.0.35",
    "jest": "^29.2.1",
    "jest-expo": "^48.0.0",
    "redux-devtools-extension": "^2.13.8",
    "ts-jest": "^25.2.1",
    "typescript": "^4.9.4"
  },

If anyone has the same problem, please have a look at my answer here, and tell me whether it solved the problem:

2 Likes

Yes, your solution seems fine to me. I’ve encountered a similar problem with Firebase JS SDK v9 before and stumbled upon the same solution. It’s a problem with Firebase JS SDK not specifically with SDK 48 since Firebase JS SDK still imports AsyncStorage package from the React Native’s core: firebase-js-sdk/index.rn.ts at 96ab56bac05ccaf506ed3a02ccad5ff7e01a07d0 · firebase/firebase-js-sdk · GitHub. From React Native versions 0.59 and up, the AsyncStorage module has been moved to its own package: @react-native-async-storage/async-storage .

2 Likes

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