Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GoogleSignIn Unhadled Exception #12819

Closed
shadyaziza opened this issue Nov 1, 2017 · 4 comments
Closed

GoogleSignIn Unhadled Exception #12819

shadyaziza opened this issue Nov 1, 2017 · 4 comments

Comments

@shadyaziza
Copy link

shadyaziza commented Nov 1, 2017

I am facing a weird issue using GoogleSignIn plugin, I have not used Google signin for a couple of months now, and I decided to re-wire it again today when I faced this issue.

I am using the following test code

google_sign_in: "^1.0.1"
  firebase_auth: "^0.2.3"
import 'dart:async';

import "package:flutter/material.dart";
import "package:firebase_auth/firebase_auth.dart";
import "package:google_sign_in/google_sign_in.dart";


final FirebaseAuth _auth = FirebaseAuth.instance;
final GoogleSignIn _googleSignIn = new GoogleSignIn();

 _testSignInWithGoogle() async {
  final GoogleSignInAccount googleUser = await _googleSignIn.signIn();
  final GoogleSignInAuthentication googleAuth =
  await googleUser.authentication;
  final FirebaseUser user = await _auth.signInWithGoogle(
    accessToken: googleAuth.accessToken,
    idToken: googleAuth.idToken,
  );
  print (googleUser.displayName);
  return (user);
}
class TestSignIn extends StatefulWidget {
  @override
  _TestSignInState createState() => new _TestSignInState();
}

class _TestSignInState extends State<TestSignIn> {
   @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(title: new Text("test"),
      ),
      body: new Column(
        children: <Widget>[
          new FlatButton(onPressed: ()=>_testSignInWithGoogle(), child: new Text("Test SignIn Google"),),
          //print user
        ],
      )
    );
  }
}

The dialogue appears and I choose a Google user to SignIn then I get this exception


E/flutter (13210): [ERROR:topaz/lib/tonic/logging/dart_error.cc(16)] Unhandled exception:
E/flutter (13210): PlatformException(status, Status{statusCode=DEVELOPER_ERROR, resolution=null}, null)
E/flutter (13210): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:514)
E/flutter (13210): #1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:154)
E/flutter (13210): <asynchronous suspension>
E/flutter (13210): #2      GoogleSignIn._callMethod (package:google_sign_in/google_sign_in.dart:156)
E/flutter (13210): <asynchronous suspension>
E/flutter (13210): #3      GoogleSignIn._addMethodCall (package:google_sign_in/google_sign_in.dart:180)
E/flutter (13210): #4      GoogleSignIn.signIn (package:google_sign_in/google_sign_in.dart:237)
E/flutter (13210): #5      _testSignInWithGoogle (package:full3/TestSignIn.dart:12)
E/flutter (13210): <asynchronous suspension>
E/flutter (13210): #6      _TestSignInState.build.<anonymous closure> (package:full3/TestSignIn.dart:47)
E/flutter (13210): #7      _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:323)
E/flutter (13210): #8      _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:375)
E/flutter (13210): #9      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:102)
E/flutter (13210): #10     TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:161)
E/flutter (13210): #11     TapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:94)
E/flutter (13210): #12     PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:315)
E/flutter (13210): #13     PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:73)
E/flutter (13210): #14     PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:101)
E/flutter (13210): #15     BindingBase&SchedulerBinding&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:143)
E/flutter (13210): #16     BindingBase&SchedulerBinding&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:121)
E/flutter (13210): #17     BindingBase&SchedulerBinding&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:101)
E/flutter (13210): #18     BindingBase&SchedulerBinding&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:64)
E/flutter (13210): #19     BindingBase&SchedulerBinding&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:48)
E/flutter (13210): #20     _invoke1 (file:///b/build/slave/Linux_Engine/build/src/flutter/lib/ui/hooks.dart:105)
E/flutter (13210): #21     _dispatchPointerDataPacket (file:///b/build/slave/Linux_Engine/build/src/flutter/lib/ui/hooks.dart:63)
D/EGL_emulation(13210): eglMakeCurrent: 0xa9205720: ver 3 0 (tinfo 0x946fc060)

I do not think this problem if from Firebase side. Firebase is correctly configured with my app and works fine with username/password.

@killermonk
Copy link

Per discussion in Gitter, this was caused by a SHA mismatch.

@gsunit
Copy link

gsunit commented Sep 3, 2018

And how to tackle this SHA mismatch? @killermonk

@killermonk
Copy link

@gsunit the accepted answer here, basically: https://stackoverflow.com/questions/39144629/how-to-add-sha-1-to-android-application

You are signing your application with a certificate that Firebase/Google does not recognize. So you either need to add the certificates signature, or change the certificate you are using.

@github-actions
Copy link

github-actions bot commented Sep 2, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants