slather: [Question] Slather shows error -No object file for requested architecture

I am trying to run slather on my Xcode 7 project slather, but I get the error “Failed to load coverage: No object file for requested architecture”. Here is the command I am running (as per the instructions in http://mgrebenets.github.io/mobile ci/2015/09/21/code-coverage-for-ios-xcode-7/)

bundle exec slather coverage --input-format profdata -s --ignore "../**/*/Xcode*" --output-directory slather-report --scheme MyApp MyApp.xcodeproj

Note 1: The DerivedData folder contains these two files - Coverage.profdata and ProfileData/MyApp-39997.profdata Note 2: my project uses Pods and hence has a corresponding xcworkspace. Does this affect the use of slather?

About this issue

  • Original URL
  • State: open
  • Created 9 years ago
  • Reactions: 1
  • Comments: 15 (1 by maintainers)

Most upvoted comments

Building using xcodebuild and ONLY_ACTIVE_ARCH=YES as @JeremyWright suggested did it for me too.

For me, the problem seems to be the WatchKit app

Processing coverage file: /Users/me/Library/Developer/Xcode/DerivedData/MyApp-bcnbchizhsbufaaupqvjbsmsahtc/Build/Intermediates/CodeCoverage/MyApp/Coverage.profdata
Against binary file: /Users/me/Library/Developer/Xcode/DerivedData/MyApp-bcnbchizhsbufaaupqvjbsmsahtc/Build/Intermediates/CodeCoverage/MyApp/Products/Debug-iphonesimulator/MyApp WatchKit App.app/MyApp WatchKit App

If I rename the WatchKit app to something else, slather seems to work against the correct binary.

UPDATE: Using --binary-basename MyApp option (suggested by @haochen08 offline) worked for me.