expo: expo run:ios build fails(fresh project)

Summary

I just created a new expo project using npx create-expo-app using typescript/react navigation template and i also added @expo/webpack-config@^0.17.2 for web support, nothing else. No custom code added, just the scaffold that expo generates. When i try to run npx expo run:ios i get the following errors:

$ expo run:ios
› Planning build
› Compiling react-native Pods/React-RCTBlob » RCTFileReaderModule.mm
› Compiling react-native Pods/React-RCTImage » RCTImageStoreManager.mm
› Compiling react-native Pods/React-RCTImage » RCTImageLoader.mm
› Compiling react-native Pods/React-RCTImage » RCTImageEditingManager.mm
› Compiling react-native Pods/React-RCTImage » RCTGIFImageDecoder.mm
› Compiling react-native Pods/React-RCTBlob » RCTBlobPlugins.mm
› Compiling react-native Pods/React-RCTBlob » RCTBlobManager.mm
› Compiling react-native Pods/React-RCTBlob » RCTBlobCollector.mm
› Compiling base-app-mobile-web Pods/React-Codegen » FBReactNativeSpec-generated.mm

❌  (node_modules/expo-modules-core/ios/Swift/DynamicTypes/DynamicEnumType.swift:7:22)

   5 |  */
   6 | internal struct DynamicEnumType: AnyDynamicType {
>  7 |   let innerType: any Enumerable.Type
     |                      ^ protocol 'Enumerable' can only be used as a generic constraint because it has Self or associated type requirements
   8 | 
   9 |   func wraps<InnerType>(_ type: InnerType.Type) -> Bool {
  10 |     return innerType == InnerType.self


❌  (node_modules/expo-modules-core/ios/Swift/DynamicTypes/DynamicType.swift:21:36)

  19 |     return DynamicConvertibleType(innerType: ConvertibleType)
  20 |   }
> 21 |   if let EnumType = T.self as? any Enumerable.Type {
     |                                    ^ protocol 'Enumerable' can only be used as a generic constraint because it has Self or associated type requirements
  22 |     return DynamicEnumType(innerType: EnumType)
  23 |   }
  24 |   if let SharedObjectType = T.self as? SharedObject.Type {


❌  (node_modules/expo-modules-core/ios/Swift/Objects/PropertyComponent.swift:142:9)

  140 |       }
  141 |       guard let getter = self.getter else {
> 142 |         return
      |         ^ non-void function should return a value
  143 |       }
  144 |       return try getter.call(by: this, withArguments: args)
  145 |     }


❌  (node_modules/expo-modules-core/ios/Swift/Objects/PropertyComponent.swift:157:9)

  155 |       }
  156 |       guard let setter = self.setter else {
> 157 |         return
      |         ^ non-void function should return a value
  158 |       }
  159 |       return try setter.call(by: this, withArguments: args)
  160 |     }

› Compiling react-native Pods/React-CoreModules » React-CoreModules-dummy.m
› Compiling react-native Pods/React-CoreModules » RCTWebSocketModule.mm
› Compiling react-native Pods/React-CoreModules » RCTWebSocketExecutor.mm
› Compiling react-native Pods/React-CoreModules » RCTTiming.mm
› Compiling react-native Pods/React-CoreModules » RCTStatusBarManager.mm
› Compiling react-native Pods/React-CoreModules » RCTSourceCode.mm
› Compiling react-native Pods/React-CoreModules » RCTRedBox.mm
› Compiling react-native Pods/React-CoreModules » RCTPlatform.mm
› Compiling react-native Pods/React-CoreModules » RCTPerfMonitor.mm
› Compiling react-native Pods/React-CoreModules » RCTLogBoxView.mm
› Compiling react-native Pods/React-CoreModules » RCTLogBox.mm
› Compiling react-native Pods/React-CoreModules » RCTKeyboardObserver.mm
› Compiling react-native Pods/React-CoreModules » RCTI18nManager.mm

› 4 error(s), and 0 warning(s)```

### What platform(s) does this occur on?

iOS

### SDK Version

_No response_

### Environment

expo-env-info 1.0.5 environment info:
    System:
      OS: macOS 12.4
      Shell: 5.8.1 - /bin/zsh
    Binaries:
      Node: 14.19.2 - ~/.nvm/versions/node/v14.19.2/bin/node
      Yarn: 1.22.10 - /usr/local/bin/yarn
      npm: 6.14.17 - ~/.nvm/versions/node/v14.19.2/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    Managers:
      CocoaPods: 1.11.3 - /usr/local/bin/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5
      Android SDK:
        API Levels: 29, 30
        Build Tools: 28.0.3, 29.0.2, 30.0.2
        System Images: android-30 | Google APIs Intel x86 Atom
    IDEs:
      Android Studio: 4.1 AI-201.8743.12.41.6858069
      Xcode: 13.3.1/13E500a - /usr/bin/xcodebuild
    npmPackages:
      @expo/webpack-config: ^0.17.2 => 0.17.4 
      expo: ~47.0.12 => 47.0.12 
      react: 18.1.0 => 18.1.0 
      react-dom: 18.1.0 => 18.1.0 
      react-native: 0.70.5 => 0.70.5 
      react-native-web: ~0.18.9 => 0.18.10 
    Expo Workflow: managed

### Minimal reproducible example

npx create-expo-app, select navigation/typescript template, add @expo/webpack-config and try to build for ios.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 7
  • Comments: 19 (5 by maintainers)

Most upvoted comments

Try to upgrade expo on the app store.

I had a similar problem:


.....

❌  (node_modules/expo-modules-core/ios/Swift/DynamicTypes/DynamicEnumType.swift:7:22)

   5 |  */
   6 | internal struct DynamicEnumType: AnyDynamicType {
>  7 |   let innerType: any Enumerable.Type
     |                      ^ protocol 'Enumerable' can only be used as a generic constraint because it has Self or associated type requirements
   8 | 
   9 |   func wraps<InnerType>(_ type: InnerType.Type) -> Bool {
  10 |     return innerType == InnerType.self


❌  (node_modules/expo-modules-core/ios/Swift/DynamicTypes/DynamicType.swift:21:36)

  19 |     return DynamicConvertibleType(innerType: ConvertibleType)
  20 |   }
> 21 |   if let EnumType = T.self as? any Enumerable.Type {
     |                                    ^ protocol 'Enumerable' can only be used as a generic constraint because it has Self or associated type requirements
  22 |     return DynamicEnumType(innerType: EnumType)
  23 |   }
  24 |   if let SharedObjectType = T.self as? SharedObject.Type {


❌  (node_modules/expo-modules-core/ios/Swift/Objects/PropertyComponent.swift:142:9)

  140 |       }
  141 |       guard let getter = self.getter else {
> 142 |         return
      |         ^ non-void function should return a value
  143 |       }
  144 |       return try getter.call(by: this, withArguments: args)
  145 |     }


❌  (node_modules/expo-modules-core/ios/Swift/Objects/PropertyComponent.swift:157:9)

  155 |       }
  156 |       guard let setter = self.setter else {
> 157 |         return
      |         ^ non-void function should return a value
  158 |       }
  159 |       return try setter.call(by: this, withArguments: args)
  160 |     }

....


› 4 error(s), and 27 warning(s)

CommandError: Failed to build iOS project. "xcodebuild" exited with error code 65.
   expo-env-info 1.0.5 environment info:
      System:
        OS: macOS 12.5
        Shell: 3.2.57 - /bin/bash
      Binaries:
        Node: 18.7.0 - /usr/local/bin/node
        Yarn: 1.22.19 - /usr/local/bin/yarn
        npm: 8.15.0 - /usr/local/bin/npm
        Watchman: 2022.07.04.00 - /usr/local/bin/watchman
      Managers:
        CocoaPods: 1.11.3 - /usr/local/bin/pod
      SDKs:
        iOS SDK:
          Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
      IDEs:
        Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
      npmPackages:
        expo: ~47.0.12 => 47.0.13 
        react: 18.1.0 => 18.1.0 
        react-dom: 18.1.0 => 18.1.0 
        react-native: 0.70.5 => 0.70.5 
        react-native-web: ~0.18.7 => 0.18.10 
      npmGlobalPackages:
        expo-cli: 6.1.0
      Expo Workflow: bare

@TomasMorton have you tried to upgrade Xcode? See my comment here https://github.com/expo/expo/issues/20777#issuecomment-1379301936

@0x-s13i your issue is completely different than this, so please don’t spam here and just wait until I get to the issue you reported.

Looks like you have a pretty old version of Xcode. Could you try again after upgrading to the latest (14.2)?

Works with Xcode 14.2. Thank you.

Looks like you have a pretty old version of Xcode. Could you try again after upgrading to the latest (14.2)?