简体   繁体   English

iOS-Google登录库问题

[英]iOS - Issue with Google Sign-In library

My iOS app used the Google+ library to perform the Google Account login, but that method has been deprecated and it's not working. 我的iOS应用使用Google+库执行Google帐户登录,但是该方法已被弃用,并且无法使用。 So I want to use the new Google SignIn Library. 因此,我想使用新的Google登录库。

I have added the following to my pod file: 我已将以下内容添加到我的pod文件中:

pod ‘Google/SignIn’

Then I have run the command 'pod install' to install it. 然后,我运行命令“ pod install”进行安装。 The result: 结果:

Installing FirebaseAnalytics (3.9.0)
Installing FirebaseCore (3.6.0)
Installing FirebaseInstanceID (1.0.10)
Installing FontAwesome (4.3.0)
Installing GTMOAuth2 (1.1.4)
Installing GTMSessionFetcher (1.1.10)
Installing Google (3.0.3)
Installing GoogleSignIn (4.0.2)
Installing GoogleToolboxForMac (2.1.1)

I have opened the project and, without changing any line of code, it fails to build with the following error: 我已经打开了该项目,并且在不更改任何代码行的情况下,它无法生成并出现以下错误:

GTMOAuth2ViewControllerTouch.m:331:41: Use of undeclared identifier 'GTMOAuth2ErrorTokenUnavailable'; did you mean 'kGTMOAuth2ErrorTokenUnavailable'?

What is wrong with this library? 这个库有什么问题? It looks like it is using a variable that doesn't exist... GTMOAuth2ViewControllerTouch.m is a class from one of the new libraries installed with the Google SignIn library. 看起来它正在使用一个不存在的变量... GTMOAuth2ViewControllerTouch.m是来自与Google SignIn库一起安装的新库之一的类。

How can I use Google SignIn? 如何使用Google登录?

I'm following the official guide: https://developers.google.com/identity/sign-in/ios/start-integrating 我正在遵循官方指南: https : //developers.google.com/identity/sign-in/ios/start-integrating

In that page there is not mention of that error. 在该页面中没有提及该错误。

My Xcode version is 7.3.1. 我的Xcode版本是7.3.1。 It's an objective-c app. 这是一个Objective-C应用程序。

You can download the video from following link:- 您可以从以下链接下载视频:-

Video Link 影片连结

This happen to me when I have "googleplus-ios-sdk" pod library installed. 当我安装了“ googleplus-ios-sdk” pod库时,会发生这种情况。 After removing the library, it works. 删除库后,它可以工作。 "googleplus-ios-sdk" is an very outdated library (last update on 2014). “ googleplus-ios-sdk”是一个非常过时的库(2014年的最新更新)。

Perhaps you can create a new Xcode project, copy and install the pod libraries, and test one by one which library is having trouble with "GoogleSignIn". 也许您可以创建一个新的Xcode项目,复制并安装pod库,并逐个测试哪个库在使用“ GoogleSignIn”时遇到问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM