gpt4 book ai didi

android - Firebase 谷歌身份验证不工作。 ApiException : 12500: , 空

转载 作者:IT王子 更新时间:2023-10-29 07:02:20 49 4
gpt4 key购买 nike

是的一切都在 firebase 和 flutter 中设置得很好1)在firebase项目中添加了最新的SHA-1指纹2) 启用谷歌登录选项3) 添加了支持的邮箱

应用程序仍在调试中添加调试 key SHA-1

没有任何效果

我只是想设置一个我无法登录的简单 Google Auth 登录

我遇到了这个错误

平台异常(登录失败,com.google.android.gms.common.api.ApiException:12500:,空)

`

final FirebaseAuth auth = FirebaseAuth.instance;
final GoogleSignIn googleSignIn = new GoogleSignIn();

GoogleSignInAuthentication googleAuth;


Future<FirebaseUser> SignInWithGoogleAuth() async {

GoogleSignInAccount GSA = await googleSignIn.signIn();
//I'm getting error here ^^ at the above line code
googleAuth = await GSA.authentication;
AuthCredential credential = GoogleAuthProvider.getCredential(
accessToken: googleAuth.accessToken,
idToken: googleAuth.idToken,
);
FirebaseUser user = await auth.signInWithCredential(credential);
assert(user.email != null);
assert(user.displayName != null);
assert(!user.isAnonymous);
assert(await user.getIdToken() != null);
final FirebaseUser currentUser = await auth.currentUser();
assert(user.uid == currentUser.uid);
print('signInWithGoogle succeeded: $user');
return currentUser;

}

错误:

SetAppTypeFace- try to flip, app = borse.coaching_app
V/Monotype(22482): Typeface getFontPathFlipFont - systemFont = default#default

E/flutter (22482): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled

Exception: **PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 12500: , null)**


E/flutter (22482): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:564:7)
E/flutter (22482): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:302:33)
E/flutter (22482): <asynchronous suspension>
E/flutter (22482): #2 GoogleSignIn._callMethod (package:google_sign_in/google_sign_in.dart:226:58)
E/flutter (22482): <asynchronous suspension>
E/flutter (22482): #3 GoogleSignIn._addMethodCall (package:google_sign_in/google_sign_in.dart:268:20)
E/flutter (22482): #4 GoogleSignIn.signIn (package:google_sign_in/google_sign_in.dart:339:48)
E/flutter (22482): #5 _StartingPageState.SignInWithGoogleAuth (package:coaching_app/pages/startingPage.dart:27:50)
E/flutter (22482): <asynchronous suspension>
E/flutter (22482): #6 _StartingPageState.GoogleImg.<anonymous closure> (package:coaching_app/pages/startingPage.dart:141:26)
E/flutter (22482): <asynchronous suspension>
E/flutter (22482): #7 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:511:14)
E/flutter (22482): #8 _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:566:30)
E/flutter (22482): #9 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:166:24)
E/flutter (22482): #10 TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:240:9)
E/flutter (22482): #11 TapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:177:9)
E/flutter (22482): #12 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:436:9)
E/flutter (22482): #13 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:73:12)
E/flutter (22482): #14 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:101:11)
E/flutter (22482): #15 _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:221:19)
E/flutter (22482): #16 _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:199:22)
E/flutter (22482): #17 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7)
E/flutter (22482): #18 _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7)
E/flutter (22482): #19 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7)
E/flutter (22482): #20 _rootRunUnary (dart:async/zone.dart:1136:13)
E/flutter (22482): #21 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
E/flutter (22482): #22 _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
E/flutter (22482): #23 _invoke1 (dart:ui/hooks.dart:233:10)
E/flutter (22482): #24 _dispatchPointerDataPacket (dart:ui/hooks.dart:154:5)
E/flutter (22482):

最佳答案

我有这个错误 ApiException: 12500 很长时间了。我已经尝试了一切:

  • 删除我的调试 keystore ,重新创建一个
  • 在 Firebase 控制台上添加支持电子邮件
  • 更改插件版本
  • 在我的设备上更新谷歌

除了寻找我找到的解决方案外没有任何效果:

我去了这个页面 ( https://console.developers.google.com/apis/credential s)从列表(左上角)中选择您的项目。然后转到“Oauth 同意屏幕”

我在应用主页上填写了应用的标志和链接以及应用的隐私政策链接(与project.firebaseapp.com),然后保存。

enter image description here

之后就好了。我认为应该更新官方文档。

有关更多信息,请访问此链接 enter link description here

关于android - Firebase 谷歌身份验证不工作。 ApiException : 12500: , 空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57052845/

49 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com