- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我使用的是 Google 登录 SDK 4.0.1。当我按下 googleSignInButton 时,应用程序将崩溃。并给出了以下错误,如何解决这个问题:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Your app is missing support for the following URL schemes: com.googleusercontent.apps.107731993306-6s44u18onibp6gi0ddj94si1aifshhg6'
*** First throw call stack:
(
0 CoreFoundation 0x0000000101ac0d4b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010110121e objc_exception_throw + 48
2 CoreFoundation 0x0000000101b2a2b5 +[NSException raise:format:] + 197
3 xxxxx 0x000000010084b3cb -[GIDSignIn signInWithOptions:] + 246
4 xxxxx 0x000000010084efc2 -[GIDSignInButton pressed] + 242
5 UIKit 0x00000001028f78bc -[UIApplication sendAction:to:from:forEvent:] + 83
6 UIKit 0x0000000102a7dc38 -[UIControl sendAction:to:forEvent:] + 67
7 UIKit 0x0000000102a7df51 -[UIControl _sendActionsForEvents:withEvent:] + 444
8 UIKit 0x0000000102a7ce4d -[UIControl touchesEnded:withEvent:] + 668
9 UIKit 0x0000000102965545 -[UIWindow _sendTouchesForEvent:] + 2747
10 UIKit 0x0000000102966c33 -[UIWindow sendEvent:] + 4011
11 UIKit 0x00000001029139ab -[UIApplication sendEvent:] + 371
12 UIKit 0x000000010310072d __dispatchPreprocessedEventFromEventQueue + 3248
13 UIKit 0x00000001030f9463 __handleEventQueue + 4879
14 CoreFoundation 0x0000000101a65761 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
15 CoreFoundation 0x0000000101a4a98c __CFRunLoopDoSources0 + 556
16 CoreFoundation 0x0000000101a49e76 __CFRunLoopRun + 918
17 CoreFoundation 0x0000000101a49884 CFRunLoopRunSpecific + 420
18 GraphicsServices 0x00000001074cfa6f GSEventRunModal + 161
19 UIKit 0x00000001028f5c68 UIApplicationMain + 159
20 xxxxxxxx 0x00000001007c449f main + 111
21 libdyld.dylib 0x0000000104d5368d start + 1
22 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException`
我的 AppDelegate.Swift 是
class AppDelegate: UIResponder, UIApplicationDelegate, GIDSignInDelegate {
public func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error!) {
if (error == nil) {
let userId:NSString = user.userID as NSString; // For client-side use only!
let idToken: NSString = user.authentication.idToken as NSString; // Safe to send to the server
let fullName:NSString = user.profile.name as NSString;
let givenName:NSString = user.profile.givenName as NSString;
let familyName:NSString = user.profile.familyName as NSString;
let email:NSString = user.profile.email as NSString;
print(userId)
print(userId,idToken,fullName,givenName,familyName,email)
}
else {
print("\(error.localizedDescription)")
}
}
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
let kclientID:NSString = "107731993306-xxxxxxxxxxxxxxxxx.apps.googleusercontent.com"
GIDSignIn.sharedInstance().clientID = kclientID as String!
GIDSignIn.sharedInstance().delegate = self
return true
}
func application(application: UIApplication,
openURL url: NSURL, options: [String: AnyObject], annotation:Any, sourceApplication:String?) -> Bool {
return GIDSignIn.sharedInstance().handle(url as URL!, sourceApplication:sourceApplication, annotation: annotation)
}
Please give me the solution. Why it is crashed?
最佳答案
正如错误明确指出的那样,您的应用缺少对 url 方案的支持。
将以下方案添加到您的 info.plist
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>***Your bundle ID***</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>com.googleusercontent.apps.107731993306-6s44u18onibp6gi0ddj94si1aifshhg6</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>***Something here***</string>
</array>
</dict>
</array>
检查此 URL 中的 ID => https://developers.google.com/identity/sign-in/ios/start-integrating
你的 info.plist 应该是这样的 ->
关于ios - 单击 GoogleSignIn 按钮时应用程序崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42197729/
我正在使用 Ionic 和 google Plus cordova 插件:https://ionicframework.com/docs/v3/native/google-plus/ 我正确设置了所有
加载我有下面的代码: import {GoogleSignin} from 'react-native-google-signin'; console.log(GoogleSignin) Google
一些文档 1 2假设我必须使用 application:openURL:options:。我的问题是——因为我已经在使用该方法,并且如何实现的示例代码完全劫持了它: func application(
我目前正在开发一个 iOS 应用程序,该应用程序需要写入登录用户拥有的谷歌表。 要登录我使用的用户 GoogleSignIn pod 和附加到谷歌表我正在使用 GoogleAPIClientForRE
我是开发新手,我想为我的教室做一个应用程序,具有 Google Drive 和 Google 日历访问权限,在互联网上阅读了我应该做什么后,我首次制作了 GoogleSignIn 代码,但我有一个问题
我正在我的项目中实现 Google Sign-in,但这个问题很难。当我没有签名时,GoogleSignIn.getLastSignedInAccount(activity) 返回 null,根据 G
我添加了 G+ 按钮并尝试运行应用程序但收到 我在谷歌中找不到任何解决方案 最佳答案 查看错误消息中缺少的符号。 现在在 Xcode 的文档中查找它们。例如,SCNNetworkReachbility
我使用的是 Google 登录 SDK 4.0.1。当我按下 googleSignInButton 时,应用程序将崩溃。并给出了以下错误,如何解决这个问题: Terminating app due t
我正在按照教程找到 here .但我找不到 api:GoogleSignIn.silentSignIn()如文档中所述。 它是否已弃用或删除? 如果是,请有人更正指南。 最佳答案 正确的方法 Goog
我已成功将 GoogleSignIn 集成到我的 Android 应用程序中,但 1 小时后,访问 token 过期。如何刷新 token ? 我已经检查了 GoogleSignIn 的整个文档,但没
我试图在 GoogleSignindelegate 之后调用一个 API,它将检查现有用户,如果没有,它将打开一个表单进行注册。这是我所做的“ 我定义了一个从当前 Controller 到目标 Con
我正在尝试在我的主项目中解析编译器标志,例如 -Wno-auto-import。但我无法为 GoogleSignIn/Crashlytics/Firebase pod 设置编译器标志。我尝试将以下代码
我已使用 pod 配置了 GoogleSignIn。 我的 Pod 文件 目标‘MyApp’做 # 如果您不使用 Swift 并且不想使用动态框架,请注释下一行 使用_frameworks! #
我真的很想为我的 iOS 项目添加 Bitcode 支持,但我使用的是 Google Sign In 框架,看起来他们仍然没有向库中添加 Bitcode 支持。 我似乎找不到任何关于这是否即将推出的信
我在 Xcode 8 中使用 Firebase,当我使用命令单击导入 GoogleSignIn 时出现以下错误。 Couldn’t generate Swift Representation Erro
我在通过 Android 应用程序登录 Google Play 时遇到问题,我补充说:编译 'com.google.firebase:firebase-auth:11.4.2'和编译 'com.goo
我在名为 auth.dart 的单独文件中的类 AuthService 中有 googleSignIn 方法。 // in AuthService class /.../ Future googleS
我有以下代码用于静默登录用户 try { result = await GoogleSignIn().signInSilently().catchError((x) { print
我无法使用 GoogleSignIn(com.google.android.gms.auth.api.signin.GoogleSignIn) 和 GoogleSignInClient(com.goo
我无法在实现 Google Sign 时使用 GoogleSignIn(com.google.android.gms.auth.api.signin.GoogleSignIn) 和 GoogleSig
我是一名优秀的程序员,十分优秀!