view raw
Christopher Wade Cantley Christopher Wade Cantley - 11 months ago 139
Swift Question

Google/Analytics.h file not found when Testing

I am including the BridgingHeader.h however on importing Google/Analytics.h it can't find the file.

This works fine in the application, it only throws the error under testing.

Not sure what the issue is so any insight would be greatly appreciated.

enter image description here


I had a similar issue and fixed it by adding the Google Analytics pod to both the tests and uitests targets by opening up your podfile and modifying it as shown:

target 'MyApp' do
pod 'Google/Analytics'

target 'MyAppTests' do
pod 'Google/Analytics'

target 'MyAppUITests' do
pod 'Google/Analytics'

Once that was complete I had to run pod install twice and then it worked.