Expo SDK 41 EAS build failing

I’ve upgraded my build to use Expo SDK 41.

I’ve made no changes to my code-base but I am now getting build errors on IOS when running eas build.
It looks like a pod install error.

Output

unimodules-task-manager-interface@6.1.0 from ../node_modules/unimodules-task-manager-interface/ios
Auto-linking React Native modules for target `ZealStaging`: RNCAsyncStorage, RNCMaskedView, RNDateTimePicker, RNGestureHandler, RNReanimated, RNSVG, RNScreens, RNSharedElement, react-native-get-random-values, and react-native-safe-area-context
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
Fetching podspec for `Folly` from `../node_modules/react-native/third-party-podspecs/Folly.podspec`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
Adding spec repo `trunk` with CDN `https://cdn.cocoapods.org/`
[!] CocoaPods could not find compatible versions for pod "Firebase/Core":
  In snapshot (Podfile.lock):
    Firebase/Core (= 6.14.0)
  In Podfile:
    EXFirebaseCore (from `../node_modules/expo-firebase-core/ios`) was resolved to 3.0.0, which depends on
      Firebase/Core (= 7.7.0)
You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * changed the constraints of dependency `Firebase/Core` inside your development pod `EXFirebaseCore`.
   You should run `pod update Firebase/Core` to apply changes you've made.
[stderr] [!] `<PBXResourcesBuildPhase UUID=`13B07F8E1A680F5B00A75B9A`>` attempted to initialize an object with an unknown UUID. `CC18B063A372497ABB8B4529` for attribute: `files`. This can be the result of a merge and the unknown UUID is being discarded.
Error: pod exited with non-zero code: 1Error: pod exited with non-zero code: 1
    at ChildProcess.completionListener (/usr/local/eas-build-worker/node_modules/@expo/spawn-async/build/spawnAsync.js:52:23)
    at Object.onceWrapper (events.js:422:26)
    at ChildProcess.emit (events.js:315:20)
    at ChildProcess.EventEmitter.emit (domain.js:486:12)
    at maybeClose (internal/child_process.js:1048:16)
    at Socket.<anonymous> (internal/child_process.js:439:11)
    at Socket.emit (events.js:315:20)
    at Socket.EventEmitter.emit (domain.js:486:12)
    at Pipe.<anonymous> (net.js:673:12)
    ...
    at Object.spawnAsync [as default] (/usr/local/eas-build-worker/node_modules/@expo/spawn-async/build/spawnAsync.js:17:21)
    at Object.spawn [as default] (/usr/local/eas-build-worker/node_modules/@expo/turtle-spawn/dist/index.js:17:42)
    at Object.installPods (/usr/local/eas-build-worker/node_modules/@expo/build-tools/dist/ios/pod.js:12:33)
    at /usr/local/eas-build-worker/node_modules/@expo/build-tools/dist/builders/iosManaged.js:27:21
    at ManagedBuildContext.runBuildPhase (/usr/local/eas-build-worker/node_modules/@expo/build-tools/dist/context.js:37:34)
    at Object.iosManagedBuilder (/usr/local/eas-build-worker/node_modules/@expo/build-tools/dist/builders/iosManaged.js:26:15)
    at async build (/usr/local/eas-build-worker/dist/ios/build.js:79:16)
    at async Object.buildIos [as default] (/usr/local/eas-build-worker/dist/ios/build.js:29:31)
    at async Object.build (/usr/local/eas-build-worker/dist/build.js:31:31)
    at async BuildService.startBuildInternal (/usr/local/eas-build-worker/dist/service.js:128:33)

My Android build does complete but it crashes upon opening.

app.json

{
    "expo": {
      "name": "Appname Staging",
      "slug": "Appname-Staging",
      "version": "1.0.0",
      "owner": "appname",
      "orientation": "portrait",
      "icon": "./assets/images/icon.png",
      "scheme": "myapp",
      "userInterfaceStyle": "automatic",
      "splash": {
        "image": "./assets/images/splash3.png",
        "resizeMode": "cover",
        "backgroundColor": "#FBFAF9"
      },
      "updates": {
        "fallbackToCacheTimeout": 0
      },
      "assetBundlePatterns": [
        "**/*"
      ],
      "ios": {
        "userInterfaceStyle": "dark",
        "supportsTablet": false,
        "bundleIdentifier": "com.appname.staging.Appname",
        "googleServicesFile": "./GoogleService-staging-Info.plist",
        "infoPlist": {
          "NSPhotoLibraryUsageDescription": "Allow Appname access to your Photo Library",
          "NSLocationWhenInUseUsageDescription": "Allow Appname to use your location",
          "UIBackgroundModes": [
            "location",
            "fetch"
          ]
        }
      },
      "android": {
        "adaptiveIcon": {
          "foregroundImage": "./assets/images/adaptive-icon.png",
          "backgroundColor": "#FBFAF9"
        },
        "package": "com.appname.staging.Appname",
        "googleServicesFile": "./google-services-staging.json",
        "permissions": [
          "ACCESS_FINE_LOCATION",
          "CAMERA",
          "MEDIA_LIBRARY",
          "READ_EXTERNAL_STORAGE",
          "WRITE_EXTERNAL_STORAGE"
        ],
        "useNextNotificationsApi": true
      },
      "web": {
        "favicon": "./assets/images/favicon.png"
      },
      "extra": {
        "REACT_NATIVE_FIREBASE_APP_ID_ANDROID": "MYID",
        "REACT_NATIVE_FIREBASE_APP_ID_IOS": "MYID",
        "REACT_NATIVE_FIREBASE_API_KEY_ANDROID": "KEY",
        "REACT_NATIVE_FIREBASE_API_KEY_IOS": "KEY",
        "REACT_NATIVE_FIREBASE_PROJECT_ID": "KEY",
        "REACT_NATIVE_FIREBASE_STORAGE_BUCKET": "KEY",
        "REACT_NATIVE_FIREBASE_MESSAGE_SENDER_ID": "KEY",
        "REACT_NATIVE_FIREBASE_AUTH_DOMAIN": "KEY",
        "BUNDLE_IDENTIFIER": "IDENTIFIER",
        "PACKAGE_IDENTIFIER": "IDENTIFIER",
        "REACT_NATIVE_BACKEND_URL": "BE_URL",
        "REACT_NATIVE_SITE_URL": "SITE_URL",
        "REACT_NATIVE_EXPO_EXPERIENCE_ID": "EXP_ID"
      }
    }
  }

eas.json

{
  "builds": {
    "android": {
      "release": {
        "workflow": "managed"
      },
      "staging": {
        "distribution": "internal",
        "releaseChannel": "staging",
        "workflow": "managed",
        "buildType": "apk"
      }
    },
    "ios": {
      "release": {
        "workflow": "managed"
      },
      "staging": {
        "distribution": "internal",
        "releaseChannel": "staging",
        "workflow": "managed"
      }
    }
  }
}

package.json

{
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "yarn configure:develop && expo start --clear",
    "start:no-dev": "yarn configure:develop && expo start --no-dev --minify --clear",
    "start:staging": "yarn configure:staging && expo start --clear",
    "android": "yarn configure:develop && expo start --android",
    "ios": "yarn configure:develop && expo start --ios",
    "web": "yarn configure:develop && expo start --web",
    "eject": "expo eject",
    "test": "yarn configure:develop && jest --watchAll",
    "build:staging:android": "yarn configure:staging && expo build:android --release-channel staging",
    "build:staging:ios": "yarn configure:staging && expo build:ios --release-channel staging",
    "eas:build:staging": "yarn configure:staging && eas build --profile staging --platform all",
    "eas:build:staging:android": "yarn configure:staging && eas build --profile staging --platform android",
    "eas:build:staging:ios": "yarn configure:staging && eas build --profile staging --platform ios",
    "register:ios": "eas device:create",
    "configure:develop": "node flavorConfig development",
    "configure:staging": "node flavorConfig staging && ./commitConfig.sh staging",
    "configure:production": "node flavorConfig production && ./commitConfig.sh production"
  },
  "jest": {
    "preset": "jest-expo"
  },
  "dependencies": {
    "@expo-google-fonts/inter": "^0.1.0",
    "@expo-google-fonts/karla": "^0.1.0",
    "@expo/vector-icons": "^12.0.0",
    "@expo/webpack-config": "~0.12.63",
    "@hookform/resolvers": "^1.3.4",
    "@react-native-async-storage/async-storage": "^1.13.0",
    "@react-native-community/datetimepicker": "3.2.0",
    "@react-native-community/masked-view": "0.1.10",
    "@react-navigation/bottom-tabs": "5.11.2",
    "@react-navigation/native": "~5.8.10",
    "@react-navigation/stack": "~5.12.8",
    "@reduxjs/toolkit": "^1.5.0",
    "@zealmatch/schema": "2.4.1",
    "axios": "^0.21.1",
    "axios-hooks": "^2.3.0",
    "date-fns": "^2.17.0",
    "debounce": "^1.2.1",
    "dotenv": "^8.2.0",
    "expo": "^41.0.0",
    "expo-app-loading": "^1.0.1",
    "expo-asset": "~8.3.1",
    "expo-checkbox": "~1.0.3",
    "expo-constants": "~10.1.3",
    "expo-device": "~3.2.0",
    "expo-firebase-analytics": "~4.0.2",
    "expo-firebase-core": "~3.0.0",
    "expo-font": "~9.1.0",
    "expo-image-manipulator": "~9.1.0",
    "expo-image-picker": "~10.1.3",
    "expo-linear-gradient": "~9.1.0",
    "expo-linking": "~2.2.3",
    "expo-location": "~12.0.4",
    "expo-media-library": "~12.0.2",
    "expo-notifications": "~0.11.5",
    "expo-permissions": "~12.0.1",
    "expo-splash-screen": "~0.10.2",
    "expo-status-bar": "~1.0.4",
    "expo-web-browser": "~9.1.0",
    "firebase": "8.2.3",
    "fs": "^0.0.1-security",
    "geofirestore": "^4.4.1",
    "joi": "^17.3.0",
    "lodash.merge": "^4.6.2",
    "react": "16.13.1",
    "react-dom": "16.13.1",
    "react-hook-form": "^6.15.1",
    "react-native": "https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz",
    "react-native-elements": "^3.1.0",
    "react-native-gesture-handler": "~1.10.2",
    "react-native-get-random-values": "~1.7.0",
    "react-native-masonry-list": "^2.16.1",
    "react-native-safe-area-context": "3.2.0",
    "react-native-screens": "~3.0.0",
    "react-native-shared-element": "0.7.0",
    "react-native-svg": "12.1.0",
    "react-native-toast-message": "^1.4.4",
    "react-native-web": "~0.13.12",
    "react-redux": "^7.2.2",
    "redux-persist": "^6.0.0",
    "rn-range-slider": "^2.0.4",
    "text-encoding-polyfill": "^0.6.7",
    "uuid": "^8.3.2",
    "yup": "^0.32.9"
  },
  "devDependencies": {
    "@babel/core": "~7.9.0",
    "@types/react": "~16.9.35",
    "@types/react-native": "~0.63.2",
    "jest-expo": "^41.0.0",
    "typescript": "~4.0.0"
  },
  "private": true
}

i can see here in the changelog

expo-firebase-core

Am i doing something incorrect?

looks like this could be due to the fact that we cache the Podfile.lock - Caching dependencies - Expo Documentation

Could you try adding the cache field to eas.json to explicitly invalidate it?

Hey Charlie, thanks for your reply.

is this correct?

{
  "builds": {
    "android": {
      "release": {
        "workflow": "managed"
      },
      "staging": {
        "distribution": "internal",
        "releaseChannel": "staging",
        "workflow": "managed",
        "buildType": "apk"
      }
    },
    "ios": {
      "release": {
        "workflow": "managed",
        "cache": {
          "disabled": true
        }
      },
      "staging": {
        "distribution": "internal",
        "releaseChannel": "staging",
        "workflow": "managed",
        "cache": {
          "disabled": true
        }
      }
    }
  }
}

Update, with cache disabled in the format above the IOS build still fails.

I’m thinking maybe i’m not formatting my eas.json correctly because i can see this stage in my build logs.

Stage: Restore cache

Restoring files from cache:

- /Users/expo/workingdir/build/ios/Podfile.lock

Actually false alarm i added a new key to the cache in order to invalid the cache and worked. thank you!

1 Like

Awesome! glad to hear it :slight_smile: this will be fixed by this PR- https://github.com/expo/eas-cli/pull/341- thanks so much for bringing it up here