0

We are trying to migrate our code from XCode 12 to 13. Our code and all dependencies were compiling on XCode 12.

However, since we moved to XCode 13 our unit test target is not compiling. We are using the following:

XCode 13.1
Mac OS 11.6
Carthage for dependency management.
Fastlane to execute tests.

The app, UI Tests, and another test suite are compiling successfully. The test compilation seems to get stuck after a certain number of files and when we stop the compilation it throws the following error

CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler (in target 'AppNameTests' from project 'AppName')

Command CompileSwiftSources failed with a nonzero exit code

We have tried the following:

iOS Deployment Target -> 12
Other Linker flags -> -ObjC
Delete Carthage-cache and rebuild Carthage

Nothing seems to work. Any help is appreciated.

i.am.it
  • 21
  • 3

2 Answers2

0

To resolve this, we removed reference to the files which are generating the error. Add them one by one to the project.

Adding files again resolved the compilation error.

i.am.it
  • 21
  • 3
-1

Have you set your xcode-select to Xcode 13?

xcode-select -s /Applications/Xcode\ 13.1.app/

For me:

$ xcode-select --print-path
/Applications/Xcode 13.1.app/Contents/Developer
Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
  • Hey... I have only one XCode installed v13.1. Our CircleCI pipelines running on 12.3, is compiling successfully. I have other projects which are successfully compiling. `xcode-select --print-path /Applications/Xcode.app/Contents/Developer` – i.am.it Nov 23 '21 at 09:14
  • This might sound silly, but seems like a computer restart helped a lot of people https://github.com/facebook/react-native/issues/28777#issuecomment-653492992 – Matthew Benjamin Nov 23 '21 at 21:55