xcode错误:“使用未解析的标识符:GGLContext" (没有CocoaPods) [英] xcode error: "Use of unresolved identifier: GGLContext" (without CocoaPods)
问题描述
我已经进行了几年的Web开发,这是我第一个使用iOS应用程序的项目.我已按照Google 获取iOS版Google登录SDK的所有说明(没有CocoaPods),我尝试模拟该应用程序,但出现此错误:Use of unresolved identifier 'GGLContext'
I have done web development for a couple years and this is my first project with an iOS application. I have followed all of the instructions from Google's Get the Google Sign-in SDK for iOS (without CocoaPods), and I tried simulating the application and I'm getting this error: Use of unresolved identifier 'GGLContext'
这是从Google页面复制并放入AppDelegate.swift中的代码:
This is the code that is copied from Google's page and put into AppDelegate.swift :
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
// Initialize Google sign-in
var configureError: NSError?
GGLContext.sharedInstance().configureWithError(&configureError) // THIS LINE HAS THE ERROR
assert(configureError == nil, "Error configuring Google services: \(configureError)")
//GIDSignIn.sharedInstance().delegate = self
GIDSignIn.sharedInstance().clientID = MY_CLIENT_ID
return true
}
有帮助吗?
推荐答案
I faced the same problem as you then I decided to read the Google's Tutorial again, looking for the word "manually", and here's what they say:
注意 :如果您手动安装了SDK,则应该使用以下方法直接配置 GIDSignIn 对象 :在 GoogleService-Info.plist 文件中找到的客户端ID :
Note: If you manually installed the SDK, you should instead configure the GIDSignIn object directly, using the client ID found in the GoogleService-Info.plist file:
GIDSignIn.sharedInstance().clientID = kClientID
因此,只需注释与 GGLContext 相关的行,我认为这应该适用于此问题.
So just comment the lines related to GGLContext and I think that should work for this problem.
这篇关于xcode错误:“使用未解析的标识符:GGLContext" (没有CocoaPods)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!