iOS build fails when adding expo-update package

Hi,

I’m using managed workflow with expo sdk 45 and eas-cli 5.4.9.

iOS build works fine until I install expo-update (“expo-updates”: “~0.13.2”) and then it fails in the “run fastlane” phase with the following:

❌  (/Users/expo/workingdir/build/mobile-app/node_modules/expo-updates/ios/EXUpdates/CodeSigning/EXUpdatesSignatureHeaderInfo.swift:4:8)

  2 | 
  3 | import Foundation
> 4 | import EXStructuredHeaders
    |        ^ no such module 'EXStructuredHeaders'
  5 | 
  6 | struct EXUpdatesSignatureHeaderFields {
  7 |   static let SignatureFieldKey = "sig"

862

▸ ** ARCHIVE FAILED **

863

▸ The following build commands failed:

864

▸ 	CompileSwift normal arm64 (in target 'EXUpdates' from project 'Pods')

865

▸ 	CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'EXUpdates' from project 'Pods')

866

▸ (2 failures)

Hi @8fig-appdev

Try running expo doctor to see if it detects any incompatible package versions.

Hi @wodin ,

Expo doctor looks ok:
┌─────────────────────────────────────────────────────────────────────────┐
│ │
│ There is a new version of expo-cli available (5.4.12). │
│ You are currently using expo-cli 5.4.11 │
│ Install expo-cli globally using the package manager of your choice; │
│ for example: npm install -g expo-cli to get the latest version │
│ │
└─────────────────────────────────────────────────────────────────────────┘
:heavy_check_mark: Found all copies of expo-modules-autolinking
All copies of expo-modules-autolinking satisfy ~0.8.1 || ~0.9.0
:heavy_check_mark: Found all copies of @expo/config-plugins
All copies of @expo/config-plugins satisfy ^4.1.0
:heavy_check_mark: Found all copies of @expo/prebuild-config
All copies of @expo/prebuild-config satisfy ^4.0.0

Ok. Try removing your package-lock.json / yarn.lock and node_modules and reinstalling your dependencies.

If that doesn’t helo, please post your dependencies and devDependencies here.

@wodin , tried removing node_modules + deleting package-lock but same result.
Here are my dependencies:

"devDependencies": {
    "@babel/core": "^7.12.9",
    "@types/react": "~17.0.21",
    "@types/react-native": "~0.67.6",
    "expo-cli": "5.4.11",
    "jest-circus": "27.2.3",
    "jest-expo": "^45.0.0",
    "metro-resolver": "0.66.2",
    "react-devtools": "^4.14.0",
    "react-devtools-core": "^4.14.0",
    "react-test-renderer": "17.0.2"
  },
  "dependencies": {
    "@expo/metro-config": "0.3.17",
    "@react-native-async-storage/async-storage": "~1.17.3",
    "@react-native-community/netinfo": "8.2.0",
    "@react-native-picker/picker": "2.4.0",
    "@react-navigation/bottom-tabs": "^6.3.1",
    "@react-navigation/drawer": "^6.4.1",
    "@react-navigation/material-top-tabs": "^6.2.1",
    "@react-navigation/native": "^6.0.10",
    "@react-navigation/native-stack": "^6.6.1",
    "@testing-library/jest-native": "4.0.4",
    "@testing-library/react-native": "9.0.0",
    "amazon-cognito-identity-js": "^5.2.9",
    "aws-amplify": "^4.3.19",
    "dayjs": "^1.11.3",
    "expo": "^45.0.0",
    "expo-app-loading": "~2.0.0",
    "expo-constants": "~13.1.1",
    "expo-dev-client": "~1.0.0",
    "expo-font": "~10.1.0",
    "expo-linking": "~3.1.0",
    "expo-splash-screen": "~0.15.1",
    "expo-status-bar": "~1.3.0",
    "expo-structured-headers": "2.1.1",
    "expo-web-browser": "~10.2.1",
    "react": "17.0.2",
    "react-dom": "17.0.2",
    "react-hook-form": "^7.31.2",
    "react-native": "0.68.2",
    "react-native-email-link": "^1.13.1",
    "react-native-gesture-handler": "~2.2.1",
    "react-native-linear-gradient": "^2.5.6",
    "react-native-paper": "^4.12.0",
    "react-native-picker-select": "^8.0.4",
    "react-native-reanimated": "~2.8.0",
    "react-native-safe-area-context": "4.2.4",
    "react-native-screens": "~3.11.1",
    "react-native-svg": "12.3.0",
    "react-native-svg-transformer": "1.0.0",
    "react-native-tab-view": "^3.1.1",
    "react-native-web": "0.17.7",
    "react-query": "^3.39.1",
    "rn-tooltip": "^3.0.1",
    "tsconfig-paths-webpack-plugin": "*",
    "victory-native": "^36.5.0",
    "react-native-pager-view": "5.4.15",
    "expo-updates": "~0.13.2"
  },

Hi. Sorry for not responding sooner.

You should not have expo-cli installed as a devDependency (or dependency). It should be installed globally instead.

If I run expo doctor now, with your dependencies/devDependencies it complains about @expo/config-plugins@5.0.0. This appears to be a bug. I’m not sure if it’s a bug in expo doctor or in dependency versions of some Expo packages.

Do you need this?

These look to me like they should be devDependencies, rather than dependencies, although I’m not sure how much difference it actually makes.

I ran expo install on a bunch of the expo packages and there were some minor changes. I also removed the expo-cli and @expo/metro-config dependencies and it builds for me.

Here are the dependencies:

  "dependencies": {
    "@react-native-async-storage/async-storage": "~1.17.3",
    "@react-native-community/netinfo": "8.2.0",
    "@react-native-picker/picker": "2.4.0",
    "@react-navigation/bottom-tabs": "^6.3.1",
    "@react-navigation/drawer": "^6.4.1",
    "@react-navigation/material-top-tabs": "^6.2.1",
    "@react-navigation/native": "^6.0.10",
    "@react-navigation/native-stack": "^6.6.1",
    "@testing-library/jest-native": "4.0.4",
    "@testing-library/react-native": "9.0.0",
    "amazon-cognito-identity-js": "^5.2.9",
    "aws-amplify": "^4.3.19",
    "dayjs": "^1.11.3",
    "expo": "^45.0.0",
    "expo-app-loading": "~2.0.0",
    "expo-constants": "~13.1.1",
    "expo-dev-client": "~1.0.1",
    "expo-font": "~10.1.0",
    "expo-linking": "~3.1.0",
    "expo-splash-screen": "~0.15.1",
    "expo-status-bar": "~1.3.0",
    "expo-structured-headers": "^2.2.1",
    "expo-updates": "~0.13.3",
    "expo-web-browser": "~10.2.1",
    "react": "17.0.2",
    "react-dom": "17.0.2",
    "react-hook-form": "^7.31.2",
    "react-native": "0.68.2",
    "react-native-email-link": "^1.13.1",
    "react-native-gesture-handler": "~2.2.1",
    "react-native-linear-gradient": "^2.5.6",
    "react-native-pager-view": "5.4.15",
    "react-native-paper": "^4.12.0",
    "react-native-picker-select": "^8.0.4",
    "react-native-reanimated": "~2.8.0",
    "react-native-safe-area-context": "4.2.4",
    "react-native-screens": "~3.11.1",
    "react-native-svg": "12.3.0",
    "react-native-svg-transformer": "1.0.0",
    "react-native-tab-view": "^3.1.1",
    "react-native-web": "0.17.7",
    "react-query": "^3.39.1",
    "rn-tooltip": "^3.0.1",
    "tsconfig-paths-webpack-plugin": "*",
    "victory-native": "^36.5.0"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "@types/react": "~17.0.21",
    "@types/react-native": "~0.67.6",
    "jest-circus": "27.2.3",
    "jest-expo": "^45.0.0",
    "metro-resolver": "0.66.2",
    "react-devtools": "^4.14.0",
    "react-devtools-core": "^4.14.0",
    "react-test-renderer": "17.0.2"
  },