[SOLVED] Test Target not compiling on XCode 13


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.


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.

Answered By – i.am.it

Answer Checked By – Willingham (BugsFixing Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *