我正在使用Cocoapods安装最新的GPG并使用最新的XCode 7.3和iOS SDK 9.3但是我无法完成项目的构建并且遇到了这些我无法解决的5个链接器错误:
"_OBJC_CLASS_$_GSDK_GTMSessionFetcherService", referenced from:
objc-class-ref in gpg(GIPNetworkImage.o)
objc-class-ref in libSignIn_external.a(GIDSignIn.o)
"_GSDK_kGTMSessionFetcherStatusDomain", referenced from:
-[GSDK_GTMOAuth2SignIn authCodeObtained] in libGTMOAuth2_external_external.a(GTMOAuth2SignIn.o)
"_GSDK_GTMSessionFetcherAssertValidSelector", referenced from:
-[GSDK_GTMOAuth2Authentication authorizeRequest:delegate:didFinishSelector:] in libGTMOAuth2_external_external.a(GTMOAuth2Authentication.o)
-[GSDK_GTMOAuth2SignIn initWithAuthentication:authorizationURL:delegate:webRequestSelector:finishedSelector:] in libGTMOAuth2_external_external.a(GTMOAuth2SignIn.o)
"_OBJC_CLASS_$_GSDK_GTMSessionFetcher", referenced from:
objc-class-ref in libGTMOAuth2_internal_external.a(GTMOAuth2SignInInternal.o)
objc-class-ref in libGTMOAuth2_external_external.a(GTMOAuth2Authentication.o)
objc-class-ref in libGTMOAuth2_external_external.a(GTMOAuth2SignIn.o)
objc-class-ref in gpg(GPGClearcutLogger.o)
objc-class-ref in libSignIn_external.a(GIDSignIn.o)
objc-class-ref in libSignIn_external.a(GIDRuntimeConfigFetcher.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我甚至尝试在我的项目中添加GTMSessionFetcherService源,但似乎无法修复此问题。有什么想法吗?
由于
答案 0 :(得分:7)
在尝试集成Google登录时遇到了类似的构建问题。 non-Cocoapods instructions提及向您的项目添加GoogleSignIn.framework
,但他们并没有告诉您需要在登录SDK中链接其余框架:
GoogleAppUtilities.framework
GoogleAuthUtilities.framework
GoogleNetworkingUtilities.framework
GoogleSignIn.framework
GoogleSymbolUtilities.framework
GoogleUtilities.framework
答案 1 :(得分:2)
您只需添加 GoogleOpenSource.framework
从 Google+ iOS SDK 到 libs
然后
将 GoogleOpenSource添加到您的robovm.xml
最后确保 GoogleSignIn robopod 存在
答案 2 :(得分:0)
将libsqlite3.dylib,libz.tbd和AddressBook.framework添加到“Linked Frameworks and Libraries”。这解决了我的问题。我也复制了这些框架。
GoogleAppUtilities.framework
GoogleAuthUtilities.framework
GoogleNetworkingUtilities.framework
GoogleSignIn.framework
GoogleSymbolUtilities.framework
GoogleUtilities.framework
答案 3 :(得分:0)
我对Xamarin.iOS也有同样的问题。 要解决这个问题,我只需将我的Xamarin.Google.iOS.SignIn软件包更新到最新版本(4.0.1.1)并将Xamarin.Build.Download更新为最新版本(0.4.2)。
更新这两个软件包会导致额外的软件包被添加到我的项目中。我相信正是这些额外的软件包修复了我所获得的本机链接器错误(与Yanuar Tanil完全相同的错误)。