title: _googleSignIn.signInSilently() is not working
body: <p>I have copy pasted the whole code from <a href="https://pub.dev/packages/google_sign_in#-example-tab-" rel="nofollow noreferrer">https://pub.dev/packages/google_sign_in#-example-tab-</a> but still I am getting the following error on _googleSignIn.signInSilently() </p>
  
  <pre><code>Exception has occurred.
  PlatformException (PlatformException(sign_in_required, com.google.GIDSignIn, The operation couldn’t be completed. (com.google.GIDSignIn error -4.)))
  </code></pre>
  
  <p>Please have a look into below mentioned code snippet for main.dart file</p>
  
  <pre><code>// Copyright 2019 The Flutter Authors. All rights reserved.
  // Use of this source code is governed by a BSD-style license that can be
  // found in the LICENSE file.
  
  // ignore_for_file: public_member_api_docs
  
  import 'dart:async';
  import 'dart:convert' show json;
  
  import "package:http/http.dart" as http;
  import 'package:flutter/material.dart';
  import 'package:google_sign_in/google_sign_in.dart';
  
  GoogleSignIn _googleSignIn = GoogleSignIn(
    scopes: &lt;String&gt;[
      'email',
      'https://www.googleapis.com/auth/contacts.readonly',
    ],
  );
  
  void main() {
    runApp(
      MaterialApp(
        title: 'Google Sign In',
        home: SignInDemo(),
      ),
    );
  }
  
  class SignInDemo extends StatefulWidget {
    @override
    State createState() =&gt; SignInDemoState();
  }
  
  class SignInDemoState extends State&lt;SignInDemo&gt; {
    GoogleSignInAccount _currentUser;
    String _contactText;
  
    @override
    void initState() {
      super.initState();
      _googleSignIn.onCurrentUserChanged.listen((GoogleSignInAccount account) {
        setState(() {
          _currentUser = account;
        });
        if (_currentUser != null) {
          _handleGetContact();
        }
      });
      _googleSignIn.signInSilently();
    }
  
    Future&lt;void&gt; _handleGetContact() async {
      setState(() {
        _contactText = "Loading contact info...";
      });
      final http.Response response = await http.get(
        'https://people.googleapis.com/v1/people/me/connections'
        '?requestMask.includeField=person.names',
        headers: await _currentUser.authHeaders,
      );
      if (response.statusCode != 200) {
        setState(() {
          _contactText = "People API gave a ${response.statusCode} "
              "response. Check logs for details.";
        });
        print('People API ${response.statusCode} response: ${response.body}');
        return;
      }
      final Map&lt;String, dynamic&gt; data = json.decode(response.body);
      final String namedContact = _pickFirstNamedContact(data);
      setState(() {
        if (namedContact != null) {
          _contactText = "I see you know $namedContact!";
        } else {
          _contactText = "No contacts to display.";
        }
      });
    }
  
    String _pickFirstNamedContact(Map&lt;String, dynamic&gt; data) {
      final List&lt;dynamic&gt; connections = data['connections'];
      final Map&lt;String, dynamic&gt; contact = connections?.firstWhere(
        (dynamic contact) =&gt; contact['names'] != null,
        orElse: () =&gt; null,
      );
      if (contact != null) {
        final Map&lt;String, dynamic&gt; name = contact['names'].firstWhere(
          (dynamic name) =&gt; name['displayName'] != null,
          orElse: () =&gt; null,
        );
        if (name != null) {
          return name['displayName'];
        }
      }
      return null;
    }
  
    Future&lt;void&gt; _handleSignIn() async {
      try {
        await _googleSignIn.signIn();
      } catch (error) {
        print(error);
      }
    }
  
    Future&lt;void&gt; _handleSignOut() =&gt; _googleSignIn.disconnect();
  
    Widget _buildBody() {
      if (_currentUser != null) {
        return Column(
          mainAxisAlignment: MainAxisAlignment.spaceAround,
          children: &lt;Widget&gt;[
            ListTile(
              leading: GoogleUserCircleAvatar(
                identity: _currentUser,
              ),
              title: Text(_currentUser.displayName ?? ''),
              subtitle: Text(_currentUser.email ?? ''),
            ),
            const Text("Signed in successfully."),
            Text(_contactText ?? ''),
            RaisedButton(
              child: const Text('SIGN OUT'),
              onPressed: _handleSignOut,
            ),
            RaisedButton(
              child: const Text('REFRESH'),
              onPressed: _handleGetContact,
            ),
          ],
        );
      } else {
        return Column(
          mainAxisAlignment: MainAxisAlignment.spaceAround,
          children: &lt;Widget&gt;[
            const Text("You are not currently signed in."),
            RaisedButton(
              child: const Text('SIGN IN'),
              onPressed: _handleSignIn,
            ),
          ],
        );
      }
    }
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
          appBar: AppBar(
            title: const Text('Google Sign In'),
          ),
          body: ConstrainedBox(
            constraints: const BoxConstraints.expand(),
            child: _buildBody(),
          ));
    }
  }
  </code></pre>
  
  <p>I want to user firebase as my backend. But before doing so this itself is not working for me. </p>
  
  <p>I could see <a href="https://stackoverflow.com/questions/54213860/flutter-google-sign-in-stay-logged-in">Flutter google sign in stay logged in</a> : here also they are using the same technique.</p>