Google SignIn without CocoaPods
I am trying to integrate the GoogleSign-In for iOS with the documentation found here: https://developers.google.com/identity/sign-in/ios/start-integrating
How can I do this without using Cocoapods?
I’ve tried using the libraries and headers that Cocoapods download directly, but this led to many issues.
Has anyone successfully converted a Cocoapod into a standalone library/framework?
3 Solutions Collect From Internet About “Google SignIn without CocoaPods”
The standalone SDK is available here now: https://developers.google.com/identity/sign-in/ios/sdk/
As mentioned by other posters, you must add the following dependent frameworks:
You may also need to set
Other Linker Flags: -ObjC flag in your project’s build steps.
After a week of grappling with this beast, I want to update this answer for version
Google Sign-In SDK 4.0.0. The instructions at
appear to be wrong for version 4.0.0. They say you only need to link
SystemConfiguration.framework of course). However, you will get lots of mystifying
Undefined symbols for architecture x86_64
errors if that’s all you include. The
CHANGELOG.md file gets you closer to the truth with this statement:
For users of the stand-alone zip distribution, multiple frameworks are now provided and all need to be added to a project. This decomposition allows more flexibility in case of duplicated dependencies.
So in reality you also need to include:
So now you should be golden, right? As all good informercials say…
But wait, there’s more!
You also need to include
This answer gave the clue to including that library too. Without that, you will get the error
unrecognized selector sent to instance
but only on this line of code
GIDSignIn.sharedInstance().clientID = "MyClientID"
If you remark out that line, the code will work fine, even with this code still there
GIDSignIn.sharedInstance().delegate = self
To me this was the most misleading part. Most of the answers on the web for that error will say you need to set the
-ObjC, and I’m sure that’s a common cause of problems if it’s not set correctly or at all, but in my case it was clearly set right, plus the setting of the delegate worked, which meant that other properties of
GIDSignIn could be set, so why not the clientID? I thought perhaps my clientID was wrong somehow and I wasted a lot of time chasing that false clue.
All of this headache can be avoided by just using the CocoaPod, but in my case I really wanted to make it work without adding the complexity that CocoaPods bring, because I’m also including Facebook’s SDK.
P.S. I found this tutorial
to be much better written than Google’s tutorial, especially the reminder that you need to use a UIView and not a UIButton for the Google sign-in button. I spent some time confused about why I couldn’t set the button’s class to
GIDSignInButton until I came across this tutorial. Just keep in mind that you’ll need to link the libraries the way I described above rather than the way the tutorial says because it’s different now.
Also make sure you link the dependent frameworks.
See related Upgrading from Google Sign-In SDK 1.0.0 to 2.0.1 fails to compile on SKStore references.
- How to determine Internet Connection in Cocoa?
- Create and store PDF document programmatically using Swift for iOS
- How to get date and time of selected time zone from uipicker in Xcode
- List selectors for Objective-C object
- Document viewer for ipad
- IP Address? – Cocoa
- How to check if an NSDictionary or NSMutableDictionary contains a key?
- Loading records to a TableView – (More button)
- Halt when presenting ViewController with SKScene
- Little confused on Delegates in Objective-C
- How does a completion handler work on iOS?
- List of characters in an NSCharacterSet
- OpenGL ES, OpenFrameworks, Cinder and IOS creative development
- Add participant to an event in iOS
- Auto scrolling to a cell with a specific value