Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Sign in CocoaPods Install in Swift?

I am currently working on a Swift-based application that uses a mix of Objective-C and Swift-based Cocoapods.
My Podfile looks something like this:

source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '8.0'
use_frameworks!

pod 'SDWebImage', '~> 3.6'
pod 'Alamofire', '~> 1.2'
pod 'Google/SignIn'

My pods worked perfectly up until I added Google Signin.
When I did pod install, I got the following error:

[!] The 'Pods' target has transitive dependencies that include static
binaries: (~/Pods/GoogleAppUtilities/Libraries/libOpenInChrome.a, 
~/Pods/GoogleAuthUtilities/Libraries/libGTMOAuth2_internal.a, 
~/Pods/GoogleAuthUtilities/Libraries/libGTMOAuth2_external.a, 
~/Pods/GoogleNetworkingUtilities/Libraries/libGTMSessionFetcher_full.a, 
~/Pods/GoogleNetworkingUtilities/Libraries/libGTMSessionFetcher_core.a, 
~/Pods/GoogleSymbolUtilities/Libraries/libGSDK_Overload.a, 
~/Pods/GoogleUtilities/Libraries/libGTM_iPhone.a, 
~/Pods/GoogleUtilities/Libraries/libGTM_core.a, 
~/Pods/GoogleUtilities/Libraries/libGTM_UIFont+LineHeight.a, 
~/Pods/GoogleUtilities/Libraries/libGTM_SystemVersion.a, 
~/GoogleUtilities/Libraries/libGTM_StringEncoding.a, 
~/GoogleUtilities/Libraries/libGTM_RoundedRectPath.a, 
~/Pods/GoogleUtilities/Libraries/libGTM_Regex.a, 
~/Pods/GoogleUtilities/Libraries/libGTM_NSStringXML.a, 
~/Pods/GoogleUtilities/Libraries/libGTM_NSStringHTML.a, 
~/Pods/GoogleUtilities/Libraries/libGTM_NSScannerJSON.a, 
~/Pods/GoogleUtilities/Libraries/libGTM_NSDictionary+URLArguments.a, 
~/Pods/GoogleUtilities/Libraries/libGTM_KVO.a, 
~/Pods/GoogleUtilities/Libraries/libGTM_GTMURLBuilder.a, 
~/Pods/GoogleUtilities/Libraries/libGTM_DebugUtils.a, 
~/Pods/GoogleUtilities/Libraries/libGTM_AddressBook.a, and 
~/Pods/GoogleUtilities/Libraries/libGTMStackTrace.a)

Also, as soon as I add Google Signin, all the modulemaps and umbrella headers for my other pods disappear, breaking all of them.

This issue from Cocoapods seems to reference this problem as being related to my use of !use_frameworks, but only suggests a workaround (--use-libraries) on the pod publishing end, not from a user standpoint. Is this something I need to wait for Google to fix in their podspec, or is there something I can do on my end to get the Sign-in pod working?

If not, does Google still provide a way to manually install this SDK without Cocoapods?

like image 808
willrichman Avatar asked Jun 10 '15 22:06

willrichman


3 Answers

I got it working by adding this to my bridging header:

#import <GooglePlus/GooglePlus.h>
#import <GoogleOpenSource/GoogleOpenSource.h>

then swift had access to google sign in :)

like image 181
niebloomj Avatar answered Oct 01 '22 17:10

niebloomj


try below pod

pod 'GoogleSignIn', '~> 2.2'
like image 28
JayPathak Avatar answered Oct 01 '22 18:10

JayPathak


I'm quite late answering this question, but it would appear that the pod install problem was a problem with Cocoapods itself. I updated Cocoapods to its most recent version (now 0.39.0), and I was able to install all the Google pods. I was then able to add lines to my bridging header as niebloomj suggested in this answer and access all of the libraries in Swift.

like image 36
willrichman Avatar answered Oct 01 '22 17:10

willrichman