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?
- What is the proper way of distributing a dynamic framework with a dependency on a static framework?
- Unable to install 'cocoapods' gem from rubygems.org (bad response backend read error)
- Undefined symbols for architecture armv7: cocoaPods iPhone 5
- Libraries not found when using CocoaPods with iOS logic tests
- Changing an imported library using cocoapods
- Unexpected CFBundleExecutable key
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.
- Insert a PDF file into Core Data?
- What event is fired when MKMAPVIEW extent changes
- Conditional enum switch with stored enum
- Xcode derived data location
- Child View Controller shifts down
- How to Perform a Insert/Update With Core Data
- Programmatically turn on/off wifi on real iOS device with UI Automation
- Is it possible to change the iOS 8 lock screen audio label when playing from web?
- How to make a square view resize with its superview using auto layout
- How should I store UIImages within my Core Data database?
- Comparing NSIndexPath Swift
- WatchKit Extension is not seeing data saved in NSUserDefaults with App Group
- using for loop for fibonacci series to print values it will print up to 47 values above that it shows error
- Non-optional expression of type 'AnyObject' used in a check for optionals
- Assertion failure in UIPageViewController