title: Flutter Firebase Google Sign In not working. Stops after account selection
body: <p>I am currently trying to implement google sign in and authentication within my app. I have set up a project and created an app in Firebase, put the google-services.json in the application, added the necessary plugin to build.gradle, and set the SHA-1 key in firebase. Email authentication is working great, however google authentication is causing problems.</p>
  
  <p>All authentication is done from an 'authentication' package I have created. It contains an authentication page and performs all auth logic. The 'main' flutter app which is run, imports this package for use. This 'main' project's build.gradle files contain the additions for the google services plugin (<code>com.google.gms:google-services:4.3.2</code>). Once the 'main' project is run it checks if the user is currently logged in. If not it passes control to the 'authentication' package to display an auth screen and handle the login.</p>
  
  <p>The problem occurs after selecting the google account I want to login with. Once the account is selected, the account selection dialog closes and nothing happens after that. The user is not authenticated (confirmed in Firebase), no exceptions are thrown, and the try-catch surrounding everything does not catch any exceptions. It seems as if all execution of the function halts. I can still move through the app, but the sign in method never finishes execution.</p>
  
  <p>You can see the sign in method below. After the execution of the line <code>final GoogleSignInAccount googleSignInAccount = await googleSignIn.signIn();</code> execution does not continue for some reason.</p>
  
  <pre><code>///
    Future&lt;String&gt; _signUpWithGoogle() async {
      bool isLoggedIn = await _firebaseAuth.isLoggedIn();
      if (!isLoggedIn) {
        googleSignIn = GoogleSignIn();
        final GoogleSignInAccount googleSignInAccount =
            await googleSignIn.signIn();
        final GoogleSignInAuthentication googleSignInAuthentication =
            await googleSignInAccount.authentication;
  
        final AuthCredential credential = GoogleAuthProvider.getCredential(
          accessToken: googleSignInAuthentication.accessToken,
          idToken: googleSignInAuthentication.idToken,
        );
  
        final AuthResult authResult =
            await _firebaseAuth.signInWithCredential(credential);
        final FirebaseUser user = authResult.user;
  
        assert(!user.isAnonymous);
        assert(await user.getIdToken() != null);
  
        final FirebaseUser currentUser = await _firebaseAuth.getUser();
        assert(user.uid == currentUser.uid);
  
        return 'signInWithGoogle succeeded: $user';
      } else {
        FirebaseUser user = await _firebaseAuth.getUser();
        return 'signInWithGoogle succeeded: $user';
      }
    }
  </code></pre>
  
  <p>I would think a PlatformException should come back if something went wrong, but no exceptions are returned the first time. If I trigger the google sign in method again I recieve a PlatformException that says:</p>
  
  <pre><code>PlatformException(error, Concurrent operations detected: signIn, signIn, null)
  </code></pre>
  
  <p>Below you can also find the dependencies for the 'main' app and the 'authentication' package:</p>
  
  <p>'main' app dependencies</p>
  
  <pre><code>dependencies:
    flutter:
      sdk: flutter
    cupertino_icons: ^0.1.2
    permission:
    intl_translation:
    flutter_svg:
    sqflite:
    path:
    path_provider:
    uuid:
    qr_flutter:
    vibration:
    reflectable:
    provider:
    launcher_module:
      path: ../modules/launcher_module
    individual:
      path: ../modules/individual
    common:
      path: ../packages/common
    persistence:
      path: ../packages/persistence
    resources:
      path: ../packages/resources
    authentication:
      path: ../packages/authentication
    screen:
    flutter_screen_scaler: ^0.0.1
    page_indicator:
    toast: ^0.1.5
    rxbus: ^0.0.2
    shared_preferences:
  </code></pre>
  
  <p>'authentication' package dependencies</p>
  
  <pre><code>dependencies:
    flutter:
      sdk: flutter
    firebase_auth: ^0.15.3+1
    google_sign_in: ^4.1.1
    flutter_facebook_login:
    shared_preferences:
    common: 
      path: "../common"
    toast: ^0.1.5
  </code></pre>
  
  <p>I have also tried moving all authentication logic into the main app and removed the reference to the 'authentication' package. However, the same thing still happens.</p>
  
  <p>Is there something I am doing wrong or missing in all of this?</p>