EAS Build fails on Install Pods in managed workflow app

Hello - I have an app with a managed workflow so I do not have an ios folder and my EAS build is failing on the Install Pods step with the below error:

[!] Invalid `Podfile` file: cannot load such file -- /Users/expo/workingdir/build/frontend/node_modules/expo-modules-autolinking/scripts/ios/xcode_env_generator.
 #  from /Users/expo/workingdir/build/frontend/ios/Podfile:1
 #  -------------------------------------------
 >  require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
 #  require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods")
 #  -------------------------------------------
Error: Unknown error. See logs for more information.

Here is my package.json file:

{
  "scripts": {
    "start": "expo start --dev-client",
    "android": "expo run:android",
    "build": "cross-env NODE_OPTIONS=--max-old-space-size=4096 build",
    "ios": "expo run:ios",
    "web": "expo start --web",
    "eject": "expo eject"
  },
  "dependencies": {
    "@expo/ngrok": "^4.1.0",
    "@react-native-async-storage/async-storage": "~1.17.3",
    "@react-native-community/push-notification-ios": "^1.8.0",
    "@react-native-masked-view/masked-view": "^0.2.8",
    "@react-navigation/bottom-tabs": "^5.8.0",
    "@react-navigation/drawer": "^5.12.5",
    "@react-navigation/material-bottom-tabs": "^5.2.16",
    "@react-navigation/native": "^5.9.4",
    "@react-navigation/stack": "^5.14.4",
    "eas-cli": "^0.49.0",
    "expo": "^47.0.0",
    "expo-constants": "~14.0.2",
    "expo-device": "~5.0.0",
    "expo-file-system": "~15.1.1",
    "expo-firebase-analytics": "~8.0.0",
    "expo-firebase-core": "~6.0.0",
    "expo-image-manipulator": "~11.0.0",
    "expo-image-picker": "~14.0.2",
    "expo-linking": "~3.3.0",
    "expo-notifications": "~0.17.0",
    "expo-sharing": "~11.0.1",
    "expo-splash-screen": "~0.17.5",
    "expo-status-bar": "~1.4.2",
    "expo-store-review": "~6.0.0",
    "expo-system-ui": "~2.0.1",
    "expo-updates": "~0.15.6",
    "firebase": "^8.10.1",
    "moment": "^2.29.1",
    "react": "18.1.0",
    "react-dom": "18.1.0",
    "react-native": "0.70.5",
    "react-native-action-button": "^2.8.5",
    "react-native-animatable": "^1.3.3",
    "react-native-elements": "^3.4.2",
    "react-native-email": "^1.1.0",
    "react-native-gesture-handler": "~2.8.0",
    "react-native-image-crop-picker": "^0.36.0",
    "react-native-ionicons": "^4.6.5",
    "react-native-keyboard-aware-scroll-view": "^0.9.4",
    "react-native-leaderboard": "^1.0.6",
    "react-native-material-dropdown": "^0.11.1",
    "react-native-onboarding-swiper": "^1.2.0",
    "react-native-pager-view": "6.0.1",
    "react-native-paper": "^4.2.0",
    "react-native-push-notification": "^7.4.0",
    "react-native-reanimated": "~2.12.0",
    "react-native-safe-area-context": "4.4.1",
    "react-native-screens": "~3.18.0",
    "react-native-share": "^7.2.1",
    "react-native-tab-view": "^3.1.1",
    "react-native-unimodules": "^0.15.0",
    "react-native-vector-icons": "^7.1.0",
    "react-native-view-shot": "3.4.0",
    "react-native-web": "~0.18.7",
    "react-redux": "^7.2.1",
    "reanimated-bottom-sheet": "^1.0.0-alpha.22",
    "redux": "^4.0.5",
    "redux-thunk": "^2.3.0",
    "unimodules-permissions-interface": "^6.1.0"
  },
  "devDependencies": {
    "@babel/core": "^7.19.3",
    "babel-preset-expo": "~9.2.1"
  },
  "private": true,
  "name": "frontend",
  "version": "1.0.0"
}

I had no problems with expo build but can’t get it to work with EAS. Did I set up something incorrectly when setting up EAS or does anyone have any ideas?

Hi! On your latest EAS build, it seems Expo doctor is failing. Can you try running npx expo-cli --fix-dependencies to fix the dependencies issues? Then, re-run the EAS Build to see if that resolves the issues.

You also have an older version of EAS CLI added as a dependency. I’d suggest removing it too.

Thank you for the reply! I ran npx expo-cli --fix-dependencies but got ‘error: unknown option `–fix-dependencies’'. I also uninstalled eas-cli. Anyway, I cleared the Expo doctor failure by uninstalling react-native-unimodules which seemed to be causing the issue and is also deprecated. Re-ran EAS build, Expo doctor passed and I got this error:

[stderr] (node:1193) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /Users/expo/workingdir/build/frontend/node_modules/yaml/package.json.
[stderr] Update this package.json to use a subpath pattern like "./*".
[stderr] (Use `node --trace-deprecation ...` to show where the warning was created)
Using Expo modules
[Expo] Enabling modular headers for pod ExpoModulesCore
[Expo] Enabling modular headers for pod EXImageLoader
Auto-generating `.xcode.env.local` with $NODE_BINARY=/Users/expo/.nvm/versions/node/v16.18.1/bin/node
Auto-linking React Native modules for target `locctocc`: RNCAsyncStorage, RNCMaskedView, RNCPushNotificationIOS, RNGestureHandler, RNImageCropPicker, RNReanimated, RNScreens, RNShare, RNVectorIcons, react-native-ionicons, react-native-pager-view, react-native-safe-area-context, and react-native-view-shot
[Codegen] Generating ./build/generated/ios/React-Codegen.podspec.json
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
[Codegen] Found FBReactNativeSpec
Fetching podspec for `RCT-Folly` from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`
Fetching podspec for `boost` from `../node_modules/react-native/third-party-podspecs/boost.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/`
[!] Unable to find a specification for `UMCore` depended upon by `UMPermissionsInterface`
You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.
pod exited with non-zero code: 1

Any ideas? I’m wondering if uninstalling react-native-unimodules is causing some other issue now.

Aman accidentally left out part of the command. It should be:

expo-cli doctor --fix-dependencies
1 Like

My bad :sweat_smile:

no worries! I’m still a bit confused though, if I uninstall react-native-unimodules my expo doctor passes with no issues but pod install still fails with the error above (“Unable to find a specification for UMCore depended upon by UMPermissionsInterface”).

If I run expo install react-native-unimodules and then run expo-cli doctor --fix-dependencies, I get the below error:

Expected package expo-modules-autolinking@~1.0.0
Found invalid:
  expo-modules-autolinking@0.0.3
  (for more info, run: npm why expo-modules-autolinking)
Expected package @expo/config-plugins@^5.0.2
Found invalid:
  @expo/config-plugins@2.0.4
  @expo/config-plugins@3.1.0
  (for more info, run: npm why @expo/config-plugins)
Expected to not find any copies of @unimodules/core
Found invalid:
  @unimodules/core@7.1.2
  (for more info, run: npm why @unimodules/core)
Expected to not find any copies of @unimodules/react-native-adapter
Found invalid:
  @unimodules/react-native-adapter@6.3.9
  (for more info, run: npm why @unimodules/react-native-adapter)
Expected to not find any copies of react-native-unimodules
Found invalid:
  react-native-unimodules@0.14.10
  (for more info, run: npm why react-native-unimodules)

Shouldn’t expo-cli doctor --fix-dependencies address these issues?

I’ve run the following:

  1. npm uninstall react-native-unimodules
  2. expo install expo-modules
  3. expo prebuild

This cleared up my expo doctor run and I also have no issues running expo start, but when running eas build it is still failing at install pods. I don’t have a .ios folder and don’t have pods so unsure how to resolve from here. Still stuck on this error:

[stderr] (node:1216) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /Users/expo/workingdir/build/frontend/node_modules/yaml/package.json.
[stderr] Update this package.json to use a subpath pattern like "./*".
[stderr] (Use `node --trace-deprecation ...` to show where the warning was created)
Using Expo modules
[Expo] Enabling modular headers for pod ExpoModulesCore
[Expo] Enabling modular headers for pod EXImageLoader
Auto-generating `.xcode.env.local` with $NODE_BINARY=/Users/expo/.nvm/versions/node/v16.18.1/bin/node
Auto-linking React Native modules for target `locctocc`: RNCAsyncStorage, RNCMaskedView, RNCPushNotificationIOS, RNGestureHandler, RNImageCropPicker, RNReanimated, RNScreens, RNShare, RNVectorIcons, react-native-ionicons, react-native-pager-view, react-native-safe-area-context, and react-native-view-shot
[Codegen] Generating ./build/generated/ios/React-Codegen.podspec.json
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
[Codegen] Found FBReactNativeSpec
Fetching podspec for `RCT-Folly` from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`
Fetching podspec for `boost` from `../node_modules/react-native/third-party-podspecs/boost.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/`
[!] Unable to find a specification for `UMCore` depended upon by `UMPermissionsInterface`
You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.
pod exited with non-zero code: 1

Ah, I should have noticed this earlier :slight_smile:

This doesn’t ring a bell, but you probably shouldn’t have it installed.

You could probably uninstall this. If you do need it, it should rather be a devDependency.

Ideally yes, but unfortunately it can’t fix everything. I’ve also seen cases where expo-cli doctor said there were no problems, but the app wouldn’t build until I did:

rm -r yarn.lock node_modules
yarn

I assume you’ve found out by now that react-native-unimodules is old and no longer used. It was deprecated in Expo SDK 43 and removed in Expo SDK 44. See the Expo SDK 44 release announcement and What’s new in Expo modules infrastructure.

hmmm… running npx expo prebuild generates the android and ios directories. Although I generally suggest you do not run npx expo prebuild, because it effectively turns your app into a Bare app. To get back to the managed workflow, revert any changes that were made by running npx expo prebuild. The main thing is to remove android and ios directories.

I suspect you have conflicting dependencies/devDependencies. I’d try creating a new app and installing only the dependencies needed for your app to work. e.g. don’t install expo-modules. Your app does not directly need that and it should be pulled in by the stuff that needs it. Don’t touch the default JavaScript while just trying to get the native code to build.

Try building that. If that still fails, then maybe remove some of the dependencies and see if you can figure out which dependencies might be having problems with each other.

Thank you for the reply! I’ll work through all the dependencies and see what I can find. Just for my knowledge, in a managed workflow app should EAS build even have the Install Pods step? I wouldn’t have expected that it would and I never had any issues with expo build and haven’t made any change to the app.

Might also be worth noting that eas build completes no problem with Android, so not sure if its even a dependency issue if its an ios only issue.

Yes. This is part of how EAS Build is able to do everything it can do

  • Build arbitrary React Native apps
  • Add native dependencies to managed Expo apps
  • Install only what you need and not the whole bulk of the Expo SDK

See the Android build process and the iOS build process for more insight into how the build process works

It’s just a guess. I’ve seen a lot of build issues caused by certain combinations of dependencies. But since the native code is different for Android and iOS it’s definitely possible for it to work on one and fail on the other.

Thank you @wodin really appreciate all the information. I think I was able to get to the bottom of it, I’ll try to summarize what I did in case others run into the same issue:

  1. deleted packages I didn’t end up actually using in my project. Some that were causing issues seemed to be: react-native-unimodules and unimodules-permissions-interface
  2. This is what did the trick: migrated expo-firebase-analytics to @react-native-firebase/analytics following the instructions listed here fyi/firebase-migration-guide.md at main · expo/fyi (github.com)
  3. This migration also requried I set up a development build and add config plugins (also included in link in step 2)

eas build then completed successfully for ios

2 Likes