0

So I'm trying to set up the debug/release configurations in the app I'm working on. When trying to test the Release configuration, the app won't build. Says: Can't import bridging header and 'Google/Analytics.h' file not found. But this is only when running in release.

Any ideas on what could be the problem?

nathan
  • 9,329
  • 4
  • 37
  • 51
jped
  • 153
  • 1
  • 12
  • Check if in your target's 'Build Settings' > 'Swift Compiler - General' > 'Install Objective-C Compatibility Header' is enabled for both, debug and release. And also check that 'Swift Compiler - General' > 'Objective - C Bridging Header' is set for both. – vicegax Aug 01 '17 at 23:11
  • @zero is this under Target settings? If so, then yes it is set for both and both are the correct file. – jped Aug 01 '17 at 23:14
  • Have you specified the correct path for bridging header file in Build settings – Joe Aug 02 '17 at 01:52
  • @Joe it runs fine in debug mode. So I assumed yes. – jped Aug 02 '17 at 01:53
  • This reply in another thread answered my question. https://stackoverflow.com/a/32344373/6186297 – jped Aug 03 '17 at 16:32

1 Answers1

1

Another option you could try replacing the header with these lines:

#import <GoogleAnalytics/GAI.h>
#import <GoogleAnalytics/GAIDictionaryBuilder.h>
#import <GoogleAnalytics/GAIFields.h>

Found it from their reference sample app: Google Analytics iOS Quickstart app

kl.woon
  • 2,036
  • 1
  • 18
  • 10