Platformexception (sign_in_failed, status {statuscode = developer_error, resolution = null}, null) ошибка при флаттере

У меня есть приложение, в котором есть список карточек, и для карточек я сохранил тексты в базе данных firebase и изображения в хранилище firebase. Я хочу реализовать вход в Google для своего приложения. Я добавил SHA1 и SHA256, и я выполнил шаги из руководства это для реализации входа в Google. Теперь, когда я щелкнул для входа в систему, я увидел, что он не работает (вы можете увидеть в файле gif). Три дня пробую разными способами и не могу решить! здесь - это все мои коды. а вот мой журнал:

W/ActivityThread( 7024): handleWindowVisibility: no activity for token android.os.BinderProxy@bb6d004
D/EGL_emulation( 7024): eglMakeCurrent: 0xe7a85480: ver 2 0 (tinfo 0xe7a83750)
D/EGL_emulation( 7024): eglMakeCurrent: 0xe7a85480: ver 2 0 (tinfo 0xe7a83750)
E/flutter ( 7024): [ERROR:flutter/shell/common/shell.cc(181)] Dart Error: Unhandled exception:
E/flutter ( 7024): PlatformException(sign_in_failed, Status{statusCode=DEVELOPER_ERROR, resolution=null}, null)
E/flutter ( 7024): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:551:7)
E/flutter ( 7024): #1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:279:18)
E/flutter ( 7024): <asynchronous suspension>
E/flutter ( 7024): #2      GoogleSignIn._callMethod (package:google_sign_in/google_sign_in.dart:185:58)
E/flutter ( 7024): <asynchronous suspension>
E/flutter ( 7024): #3      GoogleSignIn._addMethodCall (package:google_sign_in/google_sign_in.dart:224:20)
E/flutter ( 7024): #4      GoogleSignIn.signIn (package:google_sign_in/google_sign_in.dart:292:48)
E/flutter ( 7024): #5      FBApi.signInWithGoogle (package:firebase_example/Model/Api.dart:18:64)
E/flutter ( 7024): <asynchronous suspension>
E/flutter ( 7024): #6      LoginPageState._loginUser (package:firebase_example/Ui/LoginPage.dart:19:29)
E/flutter ( 7024): <asynchronous suspension>
E/flutter ( 7024): #7      LoginPageState.build.<anonymous closure> (package:firebase_example/Ui/LoginPage.dart:81:42)
E/flutter ( 7024): <asynchronous suspension>
E/flutter ( 7024): #8      _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:503:14)
E/flutter ( 7024): #9      _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:558:30)
E/flutter ( 7024): #10     GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:102:24)
E/flutter ( 7024): #11     TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:242:9)
E/flutter ( 7024): #12     TapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:175:7)
E/flutter ( 7024): #13     PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:315:9)
E/flutter ( 7024): #14     PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:73:12)
E/flutter ( 7024): #15     PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:101:11)
E/flutter ( 7024): #16     _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:143:19)
E/flutter ( 7024): #17     _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:121:22)
E/flutter ( 7024): #18     _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:101:7)
E/flutter ( 7024): #19     _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:64:7)
E/flutter ( 7024): #20     _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:48:7)
E/flutter ( 7024): #21     _invoke1 (dart:ui/hooks.dart:142:13)
E/flutter ( 7024): #22     _dispatchPointerDataPacket (dart:ui/hooks.dart:99:5)
W/ActivityThread( 7024): handleWindowVisibility: no activity for token android.os.BinderProxy@53cfd59
I/firebaseexampl( 7024): WaitForGcToComplete blocked Background on None for 8.655ms
I/firebaseexampl( 7024): Waiting for a blocking GC ProfileSaver
I/firebaseexampl( 7024): Background concurrent copying GC freed 18668(1149KB) AllocSpace objects, 12(624KB) LOS objects, 49% free, 2MB/5MB, paused 3.574ms total 196.627ms
I/firebaseexampl( 7024): WaitForGcToComplete blocked ProfileSaver on ProfileSaver for 49.287ms
W/firebaseexampl( 7024): Accessing hidden method Ldalvik/system/CloseGuard;->warnIfOpen()V (light greylist, linking)
D/EGL_emulation( 7024): eglMakeCurrent: 0xe7a85480: ver 2 0 (tinfo 0xe7a83750)
E/flutter ( 7024): [ERROR:flutter/shell/common/shell.cc(181)] Dart Error: Unhandled exception:
E/flutter ( 7024): PlatformException(sign_in_failed, Status{statusCode=DEVELOPER_ERROR, resolution=null}, null)
E/flutter ( 7024): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:551:7)
E/flutter ( 7024): #1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:279:18)
E/flutter ( 7024): <asynchronous suspension>
E/flutter ( 7024): #2      GoogleSignIn._callMethod (package:google_sign_in/google_sign_in.dart:185:58)
E/flutter ( 7024): <asynchronous suspension>
E/flutter ( 7024): #3      GoogleSignIn._addMethodCall.<anonymous closure> (package:google_sign_in/google_sign_in.dart:237:28)
E/flutter ( 7024): #4      _RootZone.run (dart:async/zone.dart:1374:54)
E/flutter ( 7024): #5      _FutureListener.handleWhenComplete (dart:async/future_impl.dart:153:18)
E/flutter ( 7024): #6      Future._propagateToListeners.handleWhenCompleteCallback (dart:async/future_impl.dart:612:39)
E/flutter ( 7024): #7      Future._propagateToListeners (dart:async/future_impl.dart:668:37)
E/flutter ( 7024): #8      Future._addListener.<anonymous closure> (dart:async/future_impl.dart:351:9)
E/flutter ( 7024): #9      _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
E/flutter ( 7024): #10     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
D/EGL_emulation( 7024): eglMakeCurrent: 0xe7a85480: ver 2 0 (tinfo 0xe7a83750)

Это отладка или релизная сборка?

Günter Zöchbauer 10.09.2018 16:02

@ GünterZöchbauer это отладка

ali meshkani 10.09.2018 20:26
0
2
828
1

Ответы 1

Скопируйте ID клиента, который есть в вашем проекте https://console.developers.google.com. enter image description here

Вставьте идентификатор в свои ресурсы Строка проекта Android enter image description here Наконец, добавьте .requestIdToken (getString (R.string.default_web_client_id))

GoogleSignInOptions gso = new GoogleSignInOptions
            .Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
            .requestIdToken(getString(R.string.default_web_client_id))
            .requestEmail()
            .build();

Надеюсь, это было полезно :)

Другие вопросы по теме