Code coverage generation fails on M1 Mac when excluding Arm64 architecture

Hi Everyone, our project has a few vendor libraries that don't support the M1 architecture when building for the simulator, so we have to exclude the arm64 arch in order to compile.
However, when we do this, generating code coverage will fail for all targets with the following message:

Code Block
Failed to generate coverage for target 'UnitTests.app' at paths ("/Users/xxxx/Library/Developer/Xcode/DerivedData/UnitTests-dzyobvtkdsjkmlbzpenutqaqgbbl/Build/Products/Debug-iphonesimulator/UnitTests.app/UnitTests"): No object file for requested architecture

Resulting in coverage data missing for our project.

Has anyone else encountered this?
Known issue?
Any workarounds?


Thanks in advance for any help.


Yep, also encountered the same empty coverage results as you (M1, excluded arm64). Not resolved as of Xcode 12.5 beta 3.

Same issue on M1 mini, Xcode 12.5 release version. 😦

Same issue!!

Any updated from Apple engineers??

Fixed!!!!

In addition to reviewing the architecture configurations that we have surely done a thousand times and see that they were useless.

I decided to test it with the Xcode started with Roseta and I returned to have my coverage report.

Ok I think I have found a problem inside my project: some of the targets had excluded arm64 architecture so I removed that. Also update any cocoapods you have, we had some before that has set arm64 as excluded architecture, but now there is none that has that setting, so coverage is working.

Same Issue on M1, and here is a temporary solution.

The cause of this issue is M1. Before testing, Select My Mac (Rosetta) rather than My Mac on top-left selector of Xcode mid-pane.

Then everything works fine.

Same issue here on my M1 Mac mini. Works when testing under Rosetta. Super lame Apple!

Still happening, and still no movement on my bug report.

FB9088539

I'd like to start migrating my build nodes to M1 Mac minis, but without code coverage generation it grinds our build process to a halt.

KaosDG, I took a look at your bug report and it’s unclear whether your setup (where you explicitly exclude an architecture) is something that we support. I recommend that you open a DTS tech support incident so that you can discuss this with DTS’s tool’s expert.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I'm going to raise a bug with my test project attached.

Thanks. Please post the bug number once you’re done.

Knowing the etymology of the phrase, I find it quite triggering in the context of being used by an employee of a large technology company in their support forums.

I’m sorry about that but I’m not going to change my signature. Rest assured that I’m using the phrase ironically.

Also, how do you do paragraphs?

In normal posts? Or in comments?

In normal posts you just use standard Markdown syntax. In comments… well, I rarely use comments because they have serious usability issues (r. 80839588).

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Wow this is great news - seeing coverage now.

Unfortunately, this has broken tests I have with StoreKitTest framework :(

Code coverage generation fails on M1 Mac when excluding Arm64 architecture
 
 
Q