我使用最新的cocoapods版本集成了GAI。
当我在Debug配置中构建时,一切运行都很好。 但是,只要我尝试归档应用程序,编译器就会失败并显示以下消息:
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_GAIDictionaryBuilder", referenced from:
objc-class-ref in libWLCore.a(WLTrackingHelper.o)
"_OBJC_CLASS_$_GAI", referenced from:
objc-class-ref in libWLCore.a(WLTrackingHelper.o)
"_kGAIScreenName", referenced from:
+[WLTrackingHelper trackView:] in libWLCore.a(WLTrackingHelper.o)
+[WLTrackingHelper resetView] in libWLCore.a(WLTrackingHelper.o)
"_kGAIAnonymizeIp", referenced from:
+[WLTrackingHelper prepareDefaultTracker:withAnonymization:withUnCaughtExceptions:withDebug:] in libWLCore.a(WLTrackingHelper.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
由于它在Debug中工作,我试图弄清楚Debug和Release之间的配置差异在哪里。 我发现Release中的Other链接器标志是空的,而Debug中包含GoogleAnalytics和其他框架和库的标志。
将标志添加到我获得的其他链接器标志的发布配置
library not found for -lGoogleAnalyticsServices
之后,我添加了libPods,然后将libPods-GoogleAnalytics添加到Link Binary With Libraries部分,但错误保持不变。
我在这个问题上投入了差不多2天,但我找不到任何解决方案。