Christopher Wade Cantley Christopher Wade Cantley - 2 years ago 193
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

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download