expo: [SDK 43] Dev client build fails xcodebuild in expo-modules-core

Summary

Tried the dev clients on a managed expo sdk 43 project according to https://docs.expo.dev/clients/getting-started/

It throws the following errors:

> expo run:ios

...
...
› Compiling expo-modules-core Pods/ExpoModulesCore » ConcreteViewProp.swift

❌  (node_modules/expo-modules-core/ios/Swift/Views/ConcreteViewProp.swift:26:53)

  24 |     }
  25 |     guard let value = value as? PropType else {
> 26 |       fatalError("Given value `\(String(describing: value))` cannot be casted to `\(String(describing: PropType.self))`")
     |                                                     ^ variable declared in 'guard' condition is not usable in its body
  27 |     }
  28 |     setter(view, value)
  29 |   }

...
› Compiling expo-modules-core Pods/ExpoModulesCore » ModuleDefinitionComponents.swift

❌  (node_modules/expo-modules-core/ios/Swift/Modules/ModuleDefinitionComponents.swift:196:25)

  194 |  Creates the view manager definition that scopes other view-related definitions.
  195 |  */
> 196 | public func viewManager(@ViewManagerDefinitionBuilder _ closure: @escaping () -> ViewManagerDefinition) -> AnyDefinition {
      |                         ^ unknown attribute 'ViewManagerDefinitionBuilder'
  197 |   return closure()
  198 | }
  199 | 

› 2 error(s), and 1 warning(s)

Failed to build iOS project. "xcodebuild" exited with error code 65.

Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!

managed

What platform(s) does this occur on?

iOS

SDK Version (managed workflow only)

43

Environment

> expo diagnostics


  Expo CLI 4.12.10 environment info:
    System:
      OS: macOS 10.15.7
      Shell: 5.7.1 - /bin/zsh
    Binaries:
      Node: 14.17.6 - ~/.n/bin/node
      npm: 8.1.1 - ~/.n/bin/npm
      Watchman: 2021.08.30.00 - /usr/local/bin/watchman
    Managers:
      CocoaPods: 1.11.0 - /usr/local/bin/pod
    SDKs:
      iOS SDK:
        Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
    IDEs:
      Android Studio: Arctic Fox 2020.3.1 Patch 3 Arctic Fox 2020.3.1 Patch 3
      Xcode: 12.4/12D4e - /usr/bin/xcodebuild
    npmPackages:
      expo: ~43.0.0 => 43.0.1 
      react: 17.0.1 => 17.0.1 
      react-dom: 17.0.1 => 17.0.1 
      react-native: 0.64.2 => 0.64.2 
      react-native-web: 0.17.1 => 0.17.1 
    npmGlobalPackages:
      expo-cli: 4.12.10
    Expo Workflow: bare

Reproducible demo or steps to reproduce from a blank project

  • Expo init expo init DemoApp01 select “Typescript (with tabs)” template
  • Verify all versions in package.json are in sync expo upgrade 43
  • Run in simulator react-native run-ios and it works as expected
  • Verify building for simulator works expo build:ios and it succeeds as expected
  • Add dev client npm install expo-dev-client according to https://docs.expo.dev/clients/getting-started/
  • Ran expo run:ios and it fails xcodebuild

See https://gist.github.com/sshquack/1cfdafbfd3a2392a7f8099804f87341c for full error

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 8
  • Comments: 23 (9 by maintainers)

Most upvoted comments

Duplication of https://github.com/expo/expo/issues/14856. You probably need to upgrade your XCode to version 12.5 or above.

You can install Swift 5.4+ Toolchain inside an older version of XCode. See these instructions.

See all Swift releases here. I used “Swift 5.5 Development” inside XCode 12.1 on macOS Catalina and that fixed this error for me.

Hi @sshquack! Can you try installing expo-dev-client with expo install expo-dev-client? That should get the right version which should be compatible. If that doesn’t work, can you try to remove the /ios folder and run expo run:ios instead of the react-native run-ios command?

Hope this helps!

Just wanted to say I was able to get it working on XCode 13.1. In my case, the issue was that I hadn’t specified the exact Swift version for one of my targets. When I did that, everything worked!

Got exactly the same issue. Using EAS build managed workflow on Expo 41

  1. expo init - tabs template
  2. cd into project
  3. expo install expo-dev-client
  4. expo prebuild
  5. expo run:ios should work for you here

I followed these steps with Xcode 13.1 and Expo SDK 43, and got the exact same errors as in the issue description.

EDIT: reinstalled Xcode to get the latest Swift version and that fixed it; works perfectly now

@sshquack, unfortunately, how you said, you won’t be able to build the SDK 43 on your current hardware. However, if you want, you can still use dev-client with older SDK (for example 42). Event the newest expo-dev-client version (0.6.3) should work fine with older SDKs.

@ZeiRashed, if you faced that problem in XCode 13.1, please check the Swift version in your project. If your project is a little bit older and was updated multiple times, the Swift version may not be correct. You can also try to run pod deintegrate and then pod install to clear everything related to the cocopods.

Thanks for the tips!

@byCedric I tried all of those but still see the same errors. Seems like I need Xcode 12.5

@lukmccall Unfortunately Xcode 12.5 requires macOS Big Sur 11 which in-turn requires a macbook pro 2013+ per Apple spec I’m on a older 2012 model, so no OS or Xcode upgrades for me 😭

Feel free to close this issue as a duplicate of https://github.com/expo/expo/issues/14856. I won’t be trying expo dev clients until I can upgrade my hardware.