Search code examples
xcodeexpococoapodseas

How can I build my Expo app using SDK 49: CocoaPods could not find compatible versions for pod


After following the instructions to upgrade my Expo app to SDK 49, I am no longer able to build locally using

eas build --profile dev-simulator --platform ios --local --clear-cach

My build aborts with the error below.

I can build remotely and run the resulting app using expo start --dev-client --ios.

I'm baffled why this should be the case. I've deleted my node_modules and rebuilt (by running yarn) and have launched the Xcode app and ensured that the components it offers to install have been installed.

What can I do to get my app to continue building locally?


  • System Version: macOS 13.4.1 (22F82)
  • Kernel Version: Darwin 22.5.0
  • CPU: octa-core 64-bit arm_blizzard_avalanche
  • Clang: 14.0.3 build 1403
  • CLT: 14.3.1.0.1.1683849156
  • Xcode: 14.3.1

{
  ...
  "packageManager": "[email protected]",
  "dependencies": {
    "@babel/preset-typescript": "^7.22.5",
    "@config-plugins/react-native-ble-plx": "^6.0.0",
    "@fortawesome/fontawesome-svg-core": "^6.4.0",
    "@fortawesome/free-brands-svg-icons": "^6.4.0",
    "@fortawesome/pro-duotone-svg-icons": "^6.4.0",
    "@fortawesome/pro-light-svg-icons": "^6.4.0",
    "@fortawesome/pro-regular-svg-icons": "^6.4.0",
    "@fortawesome/react-native-fontawesome": "^0.3.0",
    "@fortawesome/sharp-solid-svg-icons": "^6.4.0",
    "@react-native-async-storage/async-storage": "1.18.2",
    "@react-native-community/netinfo": "9.3.10",
    "@react-native-picker/picker": "2.4.10",
    "@react-navigation/drawer": "^6.6.3",
    "@react-navigation/native": "^6.1.7",
    "@reduxjs/toolkit": "^1.9.5",
    "amazon-cognito-identity-js": "^6.3.1",
    "aws-amplify": "^5.3.3",
    "aws-amplify-react-native": "^7.0.2",
    "expo": "^49.0.0",
    "expo-dev-client": "~2.4.4",
    "expo-file-system": "~15.4.2",
    "expo-sharing": "~11.5.0",
    "expo-splash-screen": "~0.20.4",
    "expo-status-bar": "~1.6.0",
    "expo-updates": "~0.18.8",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-native": "0.72.1",
    "react-native-ble-plx": "^2.0.3",
    "react-native-gesture-handler": "~2.12.0",
    "react-native-get-random-values": "~1.8.0",
    "react-native-logs": "^5.0.1",
    "react-native-reanimated": "~3.3.0",
    "react-native-safe-area-context": "4.6.3",
    "react-native-screens": "~3.22.1",
    "react-native-svg": "13.9.0",
    "react-native-web": "~0.19.6",
    "react-redux": "^8.1.1",
    "uuid": "^9.0.0"
  },
  "devDependencies": {
    "@babel/core": "^7.22.8",
    "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
    "@babel/plugin-proposal-optional-chaining": "^7.21.0",
    "@babel/plugin-transform-arrow-functions": "^7.22.5",
    "@babel/plugin-transform-shorthand-properties": "^7.22.5",
    "@babel/plugin-transform-template-literals": "^7.22.5",
    "@redux-devtools/core": "^3.13.1",
    "@types/jest": "^29.5.2",
    "@types/react": "~18.0.27",
    "@types/react-redux": "^7.1.25",
    "@types/uuid": "^9.0.2",
    "@typescript-eslint/eslint-plugin": "^5.61.0",
    "@typescript-eslint/parser": "^5.61.0",
    "eslint": "^8.44.0",
    "eslint-plugin-jest": "^27.2.2",
    "eslint-plugin-react": "^7.32.2",
    "eslint-plugin-react-hooks": "^4.6.0",
    "jest": "^29.6.1",
    "jest-expo": "^49.0.0",
    "typescript": "^5.1.6"
  },
  ...
}

[INSTALL_PODS] Framework build type is static library
[INSTALL_PODS] [Codegen] Generating ./build/generated/ios/React-Codegen.podspec.json
[INSTALL_PODS] Analyzing dependencies
[INSTALL_PODS] Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
[INSTALL_PODS] [Codegen] Found FBReactNativeSpec
[INSTALL_PODS] Fetching podspec for `RCT-Folly` from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`
[INSTALL_PODS] [Codegen] Found rncore
[INSTALL_PODS] Fetching podspec for `boost` from `../node_modules/react-native/third-party-podspecs/boost.podspec`
[INSTALL_PODS] Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
[INSTALL_PODS] [!] CocoaPods could not find compatible versions for pod "SocketRocket":
[INSTALL_PODS]   In Podfile:
[INSTALL_PODS]     React-Core (from `../node_modules/react-native/`) was resolved to 0.72.1, which depends on
[INSTALL_PODS]       SocketRocket (= 0.6.1)
[INSTALL_PODS] None of your spec sources contain a spec satisfying the dependency: `SocketRocket (= 0.6.1)`.
[INSTALL_PODS] You have either:
[INSTALL_PODS]  * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
[INSTALL_PODS]  * mistyped the name or version.
[INSTALL_PODS]  * not added the source repo that hosts the Podspec to your Podfile.
[INSTALL_PODS] [!] `<PBXResourcesBuildPhase UUID=`13F07F8E1...B00A75B9A`>` attempted to initialize an object with an unknown UUID. `14F076057...F822C3CDB` for attribute: `files`. This can be the result of a merge and the unknown UUID is being discarded.
[INSTALL_PODS] 
Error: pod install exited with non-zero code: 31
    at ChildProcess.completionListener (/Users/Rax/.npm/_npx/2b827...8729/node_modules/@expo/spawn-async/build/spawnAsync.js:42:23)
    at Object.onceWrapper (node:events:628:26)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1091:16)
    at Socket.<anonymous> (node:internal/child_process:449:11)
    at Socket.emit (node:events:513:28)
    at Pipe.<anonymous> (node:net:322:12)
    ...
    at spawnAsync (/Users/Rax/.npm/_npx/2b827...8729/node_modules/@expo/spawn-async/build/spawnAsync.js:7:23)
    at spawn (/Users/Rax/.npm/_npx/2b827...8729/node_modules/@expo/turtle-spawn/dist/index.js:16:47)
    at installPods (/Users/Rax/.npm/_npx/2b827...8729/node_modules/@expo/build-tools/dist/ios/pod.js:11:38)
    at /Users/Rax/.npm/_npx/2b827...8729/node_modules/@expo/build-tools/dist/builders/ios.js:68:41
    at BuildContext.runBuildPhase (/Users/Rax/.npm/_npx/2b827...8729/node_modules/@expo/build-tools/dist/context.js:86:34)
    at buildAsync (/Users/Rax/.npm/_npx/2b827...8729/node_modules/@expo/build-tools/dist/builders/ios.js:67:19)
    at async runBuilderWithHooksAsync (/Users/Rax/.npm/_npx/2b827...8729/node_modules/@expo/build-tools/dist/builders/common.js:12:13)
    at async Object.iosBuilder (/Users/Rax/.npm/_npx/2b827...8729/node_modules/@expo/build-tools/dist/builders/ios.js:27:16)
    at async buildIosAsync (/Users/Rax/.npm/_npx/2b827...8729/node_modules/eas-cli-local-build-plugin/dist/ios.js:66:12)
    at async buildAsync (/Users/Rax/.npm/_npx/2b827...8729/node_modules/eas-cli-local-build-plugin/dist/build.js:55:29)

Build failed
Unknown error. See logs for more information.
npx exited with non-zero code: 1
    Error: build command failed.

Solution

  • Try running pod repo update. It will download the updated pod version. It fixed the same problem for me.