Google signin sdk in ios giving linker error

2.3k Views Asked by At

I am trying to incorporate Google Sign In into my app.

I have downloaded the Signin SDK and the sample app in it builds and works correctly.

I have tried to get the SDK to work and it is now setup exactly as per the sample app.

However I get the following errors:

Undefined symbols for architecture arm64: "_OBJC_CLASS_$_GSDK_GTMSessionFetcher", referenced from: objc-class-ref in GoogleSignIn(GIDSignIn.o) objc-class-ref in GoogleSignIn(GIDRuntimeConfigFetcher.o) "_OBJC_CLASS_$_GSDK_GTMOAuth2Keychain", referenced from: objc-class-ref in GoogleSignIn(GIDSignIn.o) "_OBJC_CLASS_$_GSDK_GTMOAuth2SignIn", referenced from: objc-class-ref in GoogleSignIn(GIDAuthentication.o) objc-class-ref in GoogleSignIn(GIDSignIn.o) "_OBJC_CLASS_$_GSDK_OpenInChromeController", referenced from: objc-class-ref in GoogleSignIn(GIDSignIn.o) "_OBJC_CLASS_$_GSDK_GTMOAuth2ViewControllerTouch", referenced from: objc-class-ref in GoogleSignIn(GIDSignIn.o) "_OBJC_CLASS_$_GSDK_GTMSessionFetcherService", referenced from: objc-class-ref in GoogleSignIn(GIDSignIn.o) "_GSDK_NSClassFromString", referenced from: l011 in GoogleSignIn(GIDSignIn.o) l059 in GoogleSignIn(GIDSignIn.o) "_OBJC_CLASS_$_GSDK_GTMOAuth2Authentication", referenced from: objc-class-ref in GoogleSignIn(GIDAuthentication.o) objc-class-ref in GoogleSignIn(GIDSignIn.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

I have therefore removed GoogleSignInDependencies.framework from the sample app to see the differences and I get the following errors:

Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_GTMOAuth2KeychainCompatibility", referenced from: objc-class-ref in GoogleSignIn(GIDAuthStateMigration_bdf842e92d17b12b5f020e0e721bd017.o) "_OBJC_CLASS_$_OIDURLQueryComponent", referenced from: objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o) "_OBJC_CLASS_$_OIDServiceConfiguration", referenced from: objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o) "_OIDResponseTypeCode", referenced from: -[GIDSignIn authenticateInteractivelyWithOptions:] in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o) "_OBJC_CLASS_$_OIDAuthorizationService", referenced from: objc-class-ref in GoogleSignIn(GIDAuthentication_7b83cc27af8929ec7e4c9760d73a0f31.o) objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o) "_OBJC_CLASS_$_GTMSessionFetcher", referenced from: objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o) "_OBJC_CLASS_$_OIDAuthorizationRequest", referenced from: objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o) "_OBJC_CLASS_$_GTMAppAuthFetcherAuthorization", referenced from: _OBJC_CLASS_$_GTMAppAuthFetcherAuthorizationWithEMMSupport in GoogleSignIn(GIDAuthentication_7b83cc27af8929ec7e4c9760d73a0f31.o) objc-class-ref in GoogleSignIn(GIDAuthentication_7b83cc27af8929ec7e4c9760d73a0f31.o) objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o) objc-class-ref in GoogleSignIn(GIDAuthStateMigration_bdf842e92d17b12b5f020e0e721bd017.o) (maybe you meant: _OBJC_CLASS_$_GTMAppAuthFetcherAuthorizationWithEMMSupport, _OBJC_CLASS_$_GTMAppAuthFetcherAuthorizationEMMChainedDelegate ) "_OIDOAuthTokenErrorDomain", referenced from: ___46-[GIDAuthentication refreshTokensWithHandler:]_block_invoke in GoogleSignIn(GIDAuthentication_7b83cc27af8929ec7e4c9760d73a0f31.o) "_OBJC_CLASS_$_OIDIDToken", referenced from: objc-class-ref in GoogleSignIn(GIDGoogleUser_2bdd4a676c033bc6ca21970e75d9159c.o) objc-class-ref in GoogleSignIn(GIDAuthentication_7b83cc27af8929ec7e4c9760d73a0f31.o) objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o) "_OBJC_METACLASS_$_GTMAppAuthFetcherAuthorization", referenced from: _OBJC_METACLASS_$_GTMAppAuthFetcherAuthorizationWithEMMSupport in GoogleSignIn(GIDAuthentication_7b83cc27af8929ec7e4c9760d73a0f31.o) (maybe you meant: _OBJC_METACLASS_$_GTMAppAuthFetcherAuthorizationEMMChainedDelegate, _OBJC_METACLASS_$_GTMAppAuthFetcherAuthorizationWithEMMSupport ) "_OIDOAuthErrorResponseErrorKey", referenced from: +[GIDAuthentication handleTokenFetchEMMError:completion:] in GoogleSignIn(GIDAuthentication_7b83cc27af8929ec7e4c9760d73a0f31.o) "_OBJC_CLASS_$_GTMKeychain", referenced from: objc-class-ref in GoogleSignIn(GIDAuthStateMigration_bdf842e92d17b12b5f020e0e721bd017.o) "_OBJC_CLASS_$_OIDAuthState", referenced from: objc-class-ref in GoogleSignIn(GIDAuthentication_7b83cc27af8929ec7e4c9760d73a0f31.o) objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

The difference seems to be that my app is using different symbols i.e. those with GSDK in. Can someone tell me what they are please and how I control this difference?

Thanks a lot Paul

2

There are 2 best solutions below

0
Paul On

This error was solved by making sure the correct frameworks are in a given folder and that the project is actually using them. The framework search path was picking up some framework that was outdated. With this cleaned up it worked.

0
Ankit Saxena On

I solved it by adding All the frameworks which are listed in GoogleSignin.framework -> Modules -> Module.modulemap to Link Binary with Libraries