I got an error when using SonarQube > SonarSwift plugin when trying to push the coverage report to SonarQube server. I generated the report using Xcode command line:
xcodebuild test -enableCodeCoverage YES -scheme iOS_Template -workspace iOS_Template.xcworkspace -destination 'platform=iOS Simulator,name=iPhone X'
And when I run sonar-scanner
to scan the codes and upload the report I got the following error:
INFO: Parse coverage report
(DerivedData/iOS_Template/Build/ProfileData/DDA1A82C-EB41-4E45-8DCF-428D3E879067/Coverage.profdata)
ERROR: Can't parse coverage report file
(DerivedData/iOS_Template/Build/ProfileData/DDA1A82C-EB41-4E45-8DCF-428D3E879067/Coverage.profdata).
No coverage information will be saved.
java.lang.IllegalStateException: Can not parse line: HƢ�F
_T0SS17iOS_TemplateTestsE11isValidatedSbAA10ValidationO10validation_tF�.�������k(_T09Alamofire12TaskDelegateC10urlSessionySo10URLSessionC_So0fB0C4taskySo11InputStreamCSgc011needNewBodyI0t3��6K�2@_T09Alamofire14SessionManagerC5retrySbAA7RequestC383��J��Z8_T09Alamofire7AFErrorO31ResponseValidationFailureReasonO22acceptableContentTypesSaySSGSgf6(��W��N
[...similar set of unknown characters...]
at com.sonar.swift.plugin.B.A(Unknown Source)
at com.sonar.swift.plugin.B.A(Unknown Source)
at java.util.Optional.ifPresent(Optional.java:159)
at com.sonar.swift.plugin.B.A(Unknown Source)
at com.sonar.swift.plugin.B.A(Unknown Source)
at com.sonar.swift.plugin.B.A(Unknown Source)
at com.sonar.swift.plugin.D.A(Unknown Source)
at com.sonar.swift.plugin.D.execute(Unknown Source)
at org.sonar.scanner.sensor.SensorWrapper.analyse(SensorWrapper.java:53)
.....
I checked the Sonarswift plugin and it looks no clue on supporting XCode9+ (my Xcode Version is Xcode 9.2) and wonder if it caused the exception