Google Sign-In v6.0.1 上的 iOS 崩溃

我正在 iOS 上从 v5.0.2 迁移到 Google Sign-In v6.0.1,但无法解决以下崩溃问题。我可以看到它在触发回调之前崩溃了,但除此之外别无他法。

崩溃

*** Terminating app due to uncaught exception 'NSInvalidArgumentException',reason: '-[GIDSignIn signInWithConfiguration:presentingViewController:callback:]: unrecognized selector sent to instance 0x600003751e80'
terminating with uncaught exception of type NSException
CoreSimulator 757.5 - Device: iPhone 12 Pro Max (9F5AB4F7-9E7C-4FD7-BB85-8251599DC05C) - Runtime: iOS 14.5 (18E182) - DeviceType: iPhone 12 Pro Max

代码

let clientId = "<MY_CLIENT_ID>"
let configuration = GIDConfiguration(clientID: clientId)
...
signInInstance.signIn(with: configuration,presenting: presentingViewController) { [weak self] user,error in
    self?.handleSignIn(user,error)
}
qzrobinh 回答:Google Sign-In v6.0.1 上的 iOS 崩溃

方法签名看起来完全没问题,我能想到的这次崩溃的唯一原因是以某种方式在您的项目中导入了框架的新旧版本,并且在运行时随机选择了旧版本

检查可执行文件的内容:产品 -> YourAppName.app -> 在 finder 中显示 -> 显示包内容 -> 框架 -> 检查那里是否只有一个 GoogleSignIn.framework -> 检查 {{1} 中的版本}

尝试清理您的衍生数据,删除 info.plist 目录并运行 Pods

本文链接:https://www.f2er.com/234.html

大家都在问