Search code examples
swiftxcode12carthage

Illegal Instruction 4 error while running the unit tests on Xcode


I recently updated to Xcode 12.3 and did the workaround to run the carthage dependencies. The build is fine but when I run the tests, I get the Illegal Instruction 4 error. I assume that the arm architecture issue causes that issue. I use Quick and Nimble coming from carthage and these are used in testing. I have tried setting the excluding archs and validate archs to yes but none of them worked.

I cannot move the libraries from carthage to pods or spm because there are so many configurations in the libraries. Updating to a new Xcode version is such a pain especially if you are using carthage.

UPDATE:

I downloaded the carthage version of 0.37 and implemented the xcframeworks into the project. To run the dependencies for xcframeworks, I run the following command:

carthage bootstrap --use-xcframeworks --no-use-binaries --platform ios

Solution

  • If you can use Carthage 0.37.0 and are able to use XCFrameworks, then this answer might be valuable for you 👍 In this vesion they added support for XCFrameworks and I find it quite nice to use. Especially since this popular workaround can finally be removed again.