Troubleshoot installing Google Analytics through CocoaPods 0.36.0 using dynamic frameworks

I am trying to update my project to use the new use_frameworks! option use_frameworks! CocoaPods 0.36.0. I am using Objective-C (not Swift) in Xcode 6.2, and the deployment target is 8.1.

Everything is built and linked correctly, with the exception of Google Analytics, for which I get linker errors:

Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_GAI", referenced from: objc-class-ref in NPDAnalytics.o "_OBJC_CLASS_$_GAIDictionaryBuilder", referenced from: objc-class-ref in NPDAnalytics.o ld: symbol(s) not found for architecture x86_64

I tried to change my old style

#import <GoogleAnalytics_iOS_SDK/GAI.h>

To import a module:

@import GoogleAnalytics_iOS_SDK;

But nothing helped.

Is GAI incompatible with CocoaPods implementation of dynamic frameworks or is there some other trick to make it work?

+5
source share
1 answer

I have successfully added this dependency by adding a platform constraint with this instruction to the podspec of your private library to restrict only iOS devices:

 Pod::Spec.new do |m| ... m.platform = :ios, "7.0" 
0
source

Source: https://habr.com/ru/post/1215941/


All Articles