Xcode 7 - Code coverage data generation failed
If you are integrating your project with a 3rd party dynamic framework, you may need to add a path in your build settings. Look for ->Build Settings->"Runpath search paths" and make sure it includes the path to the framework.
I was just seeing this exact issue myself after setting up my a project to use a framework my team has been working on. After updating this specific setting, the problem went away. In my case, the path was identical to one I already had to set for the "Framework search paths" setting.
I solved this problem, just like I solve most of those XCode Problems:
- delete your projects files in your
DerivedData
(Xcode>Preferences>Locations>DerivedData→
to jump there in finder) Product>Clean
- (keep alt-Button pressed)
Product>Clean Build Folder
- Quit XCode
- Restart XCode
- Remove your app from your device / simulator
Try again. In case it still doesn't work, use another simulator / device for a few runs. Sooner or later it will work again on the original one again.
If you are using cocoa pods, check this thread on the Cocoapods repository:https://github.com/CocoaPods/CocoaPods/issues/5385#issuecomment-226269847
This fixed my problem:
Copying @dfleming response:
For some reason, it appears that CocoaPods is not adding the "[CP] Embed Pods Frameworks" build phase to the UI Tests target when generating the project workspace.
I manually added this in and the UI Tests were runnable again.
This build phase should run the following script: (Replace {YourProject} with your project name)
"${SRCROOT}/Pods/Target Support Files/Pods-{YourProject}UITests/Pods-{YourProject}UITests-frameworks.sh"