Error while integrating Google Analytics SDK (Goog

2020-04-20 23:59发布

问题:

I am getting following error

duplicate symbol _OBJC_METACLASS_$_GAIDispatcher in:
/Shared/ThirdParty/Analytics/libGoogleAnalytics.a(GAIDispatcher.o)
/Shared/ThirdParty/Analytics/libGoogleAnalytics_debug.a(GAIDispatcher.o) ld: 212 duplicate symbols for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)

I am using coredata in my app and I have linked all the frameworks as mentioned in the doc. Also, I am compiling my app using Xcode 4.5.2.

A possible duplicate Qs could be (The Google Analytics SDK for iOS isn't built for the armv7s architecture while instaling app on iPhone) . But, I am not using Analytic v1.5.1. I am using version 2(beta).

回答1:

The problem you're seeing is because you have two Google Analytics libraries being included in your built product. The non-Debug version and the Debug version.

You need to settle on and simply use one of them. Take the non-used one out of your project or uncheck the target's "membership" checkbox in the file inspector for that unwanted library.

The checkbox I'm talking about is seen below. Instead of "UIKit.framework" (which I quickly selected to make this example), look for one of the two Google Analytics libraries and turn it off.