Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
rdinizz opened this issue Jan 10, 2023 · 19 comments
Closed

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

rdinizz opened this issue Jan 10, 2023 · 19 comments
Labels
CLI Versioned Expo CLI -- `npx expo start` needs validation Issue needs to be validated

Comments

@rdinizz
Copy link

rdinizz commented Jan 10, 2023

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.
@rdinizz rdinizz added CLI Versioned Expo CLI -- `npx expo start` needs validation Issue needs to be validated labels Jan 10, 2023
@Andres6936
Copy link

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

@0x-s13i
Copy link

0x-s13i commented Jan 11, 2023

Having the exact same probem here: #20764

@nop33
Copy link
Contributor

nop33 commented Jan 11, 2023

Same issue

@andrekundezup
Copy link

same here

@alkunde
Copy link

alkunde commented Jan 11, 2023

same error here

@tsapeta
Copy link
Member

tsapeta commented Jan 11, 2023

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

@0x-s13i

This comment was marked as off-topic.

@0x-s13i

This comment was marked as spam.

@thanksyouall
Copy link

Same

@ithunter0428
Copy link

Try to upgrade expo on the app store.

@thanksyouall
Copy link

@ithunter101 I don't use expo from the app store. I am using bare workflow...

@tsapeta
Copy link
Member

tsapeta commented Jan 12, 2023

@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.

@0x-s13i
Copy link

0x-s13i commented Jan 12, 2023

Apologies @tsapeta. Seems to be problems with the Expo Modules Core repo so I assumed it was linked in some way. I seem to have fixed some issues by manually copying the main folder on GitHub, and then came across different issues now with the AppDelegates folder. My thinking was that they would all be linked, but I hear you, and will wait until you can get around to it 👍

@TomasMorton
Copy link

I'm experiencing build failures with the same error after upgrading an existing expo bare project from 46 to 47.

@tsapeta
Copy link
Member

tsapeta commented Jan 12, 2023

@TomasMorton have you tried to upgrade Xcode? See my comment here #20777 (comment)

@TomasMorton
Copy link

@TomasMorton have you tried to upgrade Xcode? See my comment here #20777 (comment)

@tsapeta thanks for the quick reply. Definitely my mistake, I didn't realise our build agent was configured for Xcode 13.4.1. Working great now 😊

@tsapeta tsapeta closed this as completed Jan 12, 2023
@rdinizz
Copy link
Author

rdinizz commented Jan 13, 2023

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.

@vinaciotm
Copy link

Same

node -v
v16.19.0

npm -v
9.3.0

nvm -v
0.39.3

yarn -v
1.22.17

expo --version
6.1.0

xcode
13.4.1


❌  (/Users/inacio/Documents/Bitbucket/employees-app/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


❌  (/Users/inacio/Documents/Bitbucket/employees-app/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 {


❌  (/Users/inacio/Documents/Bitbucket/employees-app/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 |     }


❌  (/Users/inacio/Documents/Bitbucket/employees-app/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-RCTVibration » RCTVibration.mm
› Compiling react-native Pods/React-RCTSettings » RCTSettingsManager.mm
› Compiling react-native Pods/React-RCTNetwork » RCTNetworking.mm
› Compiling react-native Pods/React-RCTNetwork » RCTNetworkPlugins.mm
› Compiling react-native Pods/React-RCTNetwork » RCTFileRequestHandler.mm
› Compiling react-native Pods/React-RCTNetwork » RCTHTTPRequestHandler.mm
› Compiling react-native Pods/React-RCTNetwork » RCTDataRequestHandler.mm

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

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

@tsapeta
Copy link
Member

tsapeta commented Jan 16, 2023

@vinaciotm The solution has already been posted here several times. Just upgrade Xcode to the latest (14.2) and these errors should go away.

@expo expo locked as resolved and limited conversation to collaborators Jan 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLI Versioned Expo CLI -- `npx expo start` needs validation Issue needs to be validated
Projects
None yet
Development

No branches or pull requests