Pulkit Gupta
Pulkit Gupta

Reputation: 11

Facing error when deploying Expo app due to firebase

I’m trying to build my React Native Expo app for iOS using EAS Build, but I’m encountering an error related to the Firebase SDK. The error message I’m seeing is:

[!] The following Swift pods cannot yet be integrated as static libraries: The Swift pod FirebaseCoreInternal depends upon GoogleUtilities, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set use_modular_headers! globally in your Podfile, or specify :modular_headers => true for particular dependencies.

I understand that this error is related to the integration of Swift pods as static libraries. However, since I’m using Expo, I don’t directly manage a Podfile or any native code.

Expo Version:48

Firebase Version:9.21.0

Here are the relevant parts of my package.json:

"dependencies": {
  "@expo/vector-icons": "^13.0.0",
  "@react-native-async-storage/async-storage": "^1.18.1",
  "@react-navigation/native": "^6.1.6",
  "@react-navigation/native-stack": "^6.9.12",
  "@use-expo/font": "^2.0.0",
  "expo": "~48.0.15",
  "expo-firebase-recaptcha": "^2.3.1",
  "expo-linear-gradient": "~12.1.2",
  "expo-status-bar": "~1.4.4",
  "firebase": "^9.21.0",
  "moment": "^2.29.4",
  "react": "18.2.0",
  "react-native": "0.71.3",
  "react-native-otp-textinput": "^1.0.1",
  "react-native-phone-number-input": "^2.1.0",
  "expo-app-loading": "^2.1.0",
  "react-native-safe-area-context": "4.5.0",
  "react-native-screens": "~3.20.0",
  "react-native-user-avatar": "^1.0.8",
  "react-native-webview": "11.26.0",
  "twrnc": "^3.6.0",
  "uuid": "^9.0.0"
},
"devDependencies": {
  "@babel/core": "^7.20.0",
  "babel-eslint": "^10.1.0",
  "eslint": "^8.17.0",
  "eslint-plugin-react": "^7.30.0",
  "eslint-plugin-react-native": "^4.0.0"
}

I’ve tried updating my packages, clearing my npm cache, and reinstalling my node_modules, but none of these steps have resolved the issue.

Any help or guidance would be greatly appreciated. Thank you!

Since this is an expo app, I cannot edit pod file also.

Upvotes: 0

Views: 1155

Answers (1)

Ali Yousafzai
Ali Yousafzai

Reputation: 61

This fixed it for me:

  1. Add expo-build-properties package

expo add expo-build-properties

  1. Update app.json to include:

{
  "expo": {
    "plugins": [
      [
        "expo-build-properties",
        {
          "ios": {
            "useFrameworks": "static"
          }
        }
      ]
    ]
  }
}

Upvotes: 1

Related Questions