Error in gathering code coverage in Xcode16

Fails to gather code coverage and throws this error

Showing All Messages Failed to merge raw profiles in directory /Users//Library/Developer/Xcode/DerivedData/Receiver-ekqrbpsaciuxmlfslviajhoecyat/Build/ProfileData/0B0C6B69-FD46-4801-B106-56B7FCD44370 to destination /Users//Library/Developer/Xcode/DerivedData/Receiver-ekqrbpsaciuxmlfslviajhoecyat/Build/ProfileData/0B0C6B69-FD46-4801-B106-56B7FCD44370/Coverage.profdata: Aggregation tool '/Users/shwethamugeraya/Downloads/Xcode 2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/llvm-profdata' failed with exit code 1: warning: /Users/shwethamugeraya/Library/Developer/Xcode/DerivedData/Receiver-ekqrbpsaciuxmlfslviajhoecyat/Build/ProfileData/0B0C6B69-FD46-4801-B106-56B7FCD44370/2F4EFBF7-1CCF-4E9E-8FD6-482EEDB98B6C-34646.profraw: raw profile version mismatch: Profile uses raw profile format version = 4; expected version = 8 PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version. error: no profile can be merged

I'm seeing this in 16.3 as well. Possibly due to ancient .xcframeworks injected by Carthage. An older version of Xcode should be able to view the offending .profraw files and at least dump some info to show what framework it came from. Now on Sequoia, so going back far enough is no longer an option. Boo!

I've opened Feedback: FB17628220 for this. There appears to be something wrong with the later 18.3, .4 SDKs as the profraw file that is pulled from the Simulator is just in the wrong format.

FWIW, also tested in Xcode 16.4 (iOS 18.5) and still no go.

Error in gathering code coverage in Xcode16
 
 
Q