Cannot archive code

I am getting crazy "illegal instruction: 4" errors all over the place.

Carthage can't update because it is getting this error

I can't archive because my old carthage dependencies are getting this error

All of this started happening after switching to swift 5.2.4

How can I revert to swift 5.2.3?

Alternative solutions are also welcome.
Figured out how to revert to 5.2.3

That seemed to solve the problem

But I can't submit to the App Store with 5.2.3, I must use 5.2.4 so it didn't actually solve the problem

I am getting crazy "illegal instruction: 4" errors all over the place.

This means that something is crashing. Could you clarify: where are you seeing this error? Is it during your build, or e.g. during carthage update? If it's during carthage update, is it carthage itself that is crashing, or is it while running another tool such as the Swift compiler?
An "Illegal instruction: 4" will probably create a crash report. If you can find this file (it should be in the "Crash Reports" section in the macOS Console application), please attach it and your project to a report in Feedback Assistant—that should help us to investigate it.
Cannot archive code
 
 
Q