在我的 iOS 应用程序中集成 Google Analytics SDK (GoogleAnalyticsiOS_2.0beta4) 时出错 [英] Error while integrating Google Analytics SDK (GoogleAnalyticsiOS_2.0beta4) in my iOS app
问题描述
我收到以下错误
重复符号 _OBJC_METACLASS_$_GAIDispatcher 在:
/Shared/ThirdParty/Analytics/libGoogleAnalytics.a(GAIDispatcher.o)
/Shared/ThirdParty/Analytics/libGoogleAnalytics_debug.a(GAIDispatcher.o)ld:架构 armv7 clang 的 212 个重复符号:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)
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)
我在我的应用程序中使用了 coredata,并且我已经链接了文档中提到的所有框架.另外,我正在使用 Xcode 4.5.2 编译我的应用程序.
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.
一个可能的重复 Q 可能是 (在 iPhone 上安装应用程序时,适用于 iOS 的 Google Analytics SDK 不是为 armv7s 架构构建的).但是,我没有使用 Analytic v1.5.1.我使用的是版本 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).
推荐答案
您看到的问题是因为您的构建中包含了两个 Google Analytics 库产品.非调试版本和调试版本.
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.
我正在谈论的复选框如下所示.而不是UIKit.framework"(我很快就选择了它来制作这个示例),而是寻找两个 Google Analytics 库之一并将其关闭.
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.
这篇关于在我的 iOS 应用程序中集成 Google Analytics SDK (GoogleAnalyticsiOS_2.0beta4) 时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!