Jaylen J
Jaylen J

Reputation: 19

How to resolve Invalid 'expo-dev-launcher.podspec' file: undefined method 'add_dependency' for Pod:Module in React Native project

I am getting the error

Invalid Podfile file: Invalid expo-dev-launcher.podspec file: undefined method `add_dependency' for Pod:Module.

when I try to do pod install. The error is in the file [MyAppProjectName]/node_modules/expo-dev-launcher/expo-dev-launcher.podspec

I have tried installing expo-dev-launcher to see if that would provide the method that this file is looking for and a number of other things. I have also tried commenting out that line, but then it ran into the same error in another file where the file was using add_dependency(), but the error said again that that method was undefined.

Maybe I am missing a dependency or one of the dependencies should be a different version?

Ultimately, I am trying to create a local development build of my app.

Here are my dependencies in my package.json file:

 "dependencies": {
    "@babel/preset-env": "^7.24.5",
    "@babel/runtime": "^7.24.5",
    "@expo/config-plugins": "^8.0.4",
    "@expo/prebuild-config": "^7.0.4",
    "@react-native-masked-view/masked-view": "0.3.1",
    "@react-navigation/bottom-tabs": "^6.5.11",
    "@react-navigation/native": "^6.1.9",
    "@react-navigation/native-stack": "^6.9.17",
    "@react-navigation/stack": "^6.3.20",
    "apisauce": "^3.0.1",
    "core-js": "^3.35.1",
    "expo": "^49.0.0",
    "expo-app-loading": "^2.1.1",
    "expo-constants": "~16.0.1",
    "expo-dev-client": "~4.0.14",
    "expo-dev-launcher": "^4.0.15",
    "expo-dev-menu": "^5.0.14",
    "expo-font": "~12.0.5",
    "expo-modules-autolinking": "^1.11.1",
    "expo-secure-store": "~13.0.1",
    "expo-splash-screen": "~0.27.4",
    "expo-status-bar": "~1.12.1",
    "firebase": "^10.7.1",
    "formik": "^2.4.5",
    "jwt-decode": "^4.0.0",
    "react": "18.2.0",
    "react-native": "^0.72.10",
    "react-native-device-info": "^10.12.0",
    "react-native-flipper": "^0.212.0",
    "react-native-gesture-handler": "~2.16.1",
    "react-native-google-mobile-ads": "^13.3.0",
    "react-native-reanimated": "~3.10.1",
    "react-native-safe-area-context": "4.10.1",
    "react-native-screens": "3.31.1",
    "yup": "^1.3.3"
  }

Upvotes: 0

Views: 1157

Answers (1)

Ognjen Mišić
Ognjen Mišić

Reputation: 1416

Had the same issue - pulled my hair out after upgrading from expo 49 to expo 51.

Upgrading the following packages has solved the trick:

react-native 0.72.7 -> 0.74.2

react-native-gesture-handler 2.12.2 -> 2.16.2

react-native-reanimated 3.6.1 -> 3.12.0

react-native-safe-area-context 4.7.1 -> 4.10.4

react-native-screens 3.24.0 -> 3.31.1

react-native-svg 13.13.0 -> 15.3.0

react-native-web 0.19.8 -> 0.19.12

It's one of these that's the culprit so try upgrading them.

Upvotes: 0

Related Questions