Code Coverage issue for Sonar Analysis of Swift projects

Hello Team

I am getting below error for CodeCoverage during soonar analysis of swift projects:

*bash xccov-to-sonarqube-generic.sh Build/Logs/Test/Run-XXxxxxxXXX-2023.10.10_20-50-47-+0530.xcresult/*
*xccov[62435:37152656] Requested but did not find extension point with identifier Xcode.IDEFoundation.IDEResultKitSerializationConverter*
*Error: Error Domain=XCCovErrorDomain Code=0 "Failed to load coverage archive in scheme action 'Testing project XXxxxxxXXX with scheme XXxxxxxXXX' in result bundle" UserInfo={NSLocalizedDescription=Failed to load coverage archive in scheme action 'Testing project XXxxxxxXXX with scheme XXxxxxxXXX' in result bundle, NSUnderlyingError=0x6000033c4a20 {Error Domain=NSCocoaErrorDomain Code=260 "The file “Metadata.plist” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/tmp/action.xccovarchive/Metadata.plist, NSUnderlyingError=0x6000033c48d0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}}}*

I have used below command to build projects (Reference link : https://github.com/SonarSource/sonar-scanning-examples/tree/master/swift-coverage)

sh 'xcodebuild clean build test -project XXxxxxxXXX.xcodeproj/ -scheme XXxxxxxXXX -derivedDataPath Build/ -destination "platform=iOS Simulator,name=iPad Pro (11-inch) (4th generation),OS=16.2" -enableCodeCoverage YES CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO'

sh 'bash xccov-to-sonarqube-generic.sh Build/Logs/Test/*.xcresult/ >Coverage.xml'

I have even tried new xccov-to-sonarqube-generic.sh file mentioned in
link but error is same (https://github.com/SonarSource/sonar-scanning-examples/blob/master/swift-coverage/swift-coverage-example/xccov-to-sonarqube-generic.sh)

Mac OS X 13.0 x86_64
Xcode 14.1
Swift:5.7.1
SonarQube: 10.2
SonarScanner 5.0.1.3006
Java 17.0.7 Eclipse Adoptium (64-bit)

OR
Is there any alternate way or command to perform sonaranalyis for swift projects?

Let me know if any info is needed.

Thanks

Hi,

Here’s the underlying problem:

 
HTH,
Ann