title: Can't fix it: signInWithGoogle isn't defined for the class 'Firebase auth'
body: <p>The method 'signInWithGoogle' isn't defined for the class 'FirebaseAuth'.</p>
  
  <p>I have tried to change versions of pubspec.yaml file but it is not working because the firebase auth,google_sign_in,firebase analytics, firebase database are of different versions. 
  I had changed dependencies in build gradle file but it didn't help me out also.
  Either i can't find my keytool according to google to acquire SHA-1 fingerprint for firebase google authentication.</p>
  
  <pre><code>    final googleSignIn = new GoogleSignIn();
      final analytics = new FirebaseAnalytics();
      final auth = FirebaseAuth.instance;
      final reference = FirebaseDatabase.instance.reference().child('Blogs');
      String temp;
      enum _DesignAppMenuItems { profile, logout }
  
      class HomePage extends StatefulWidget {
      @override
      HomePageState createState() =&gt; new HomePageState();
      }
  
      class HomePageState extends State&lt;HomePage&gt; {
      bool loggedIn = false;
      bool _googleLoginProgress = false;
      SharedPreferences prefs;
  
      Future&lt;Null&gt; _function() async {
      SharedPreferences prefs;
      prefs = await SharedPreferences.getInstance();
      this.setState(() {
      if (prefs.getString("username") != null) {
       loggedIn = true;
        } else {
          loggedIn = false;
        }
       });
       }
  
       Future&lt;Null&gt; checkStatusOfUser() async {
       await _ensureLoggedIn();
       }
  
       Future&lt;Null&gt; _ensureLoggedIn() async {
        SharedPreferences prefs;
        prefs = await SharedPreferences.getInstance();
  
        GoogleSignInAccount user = googleSignIn.currentUser;
  
        try {
        if (user == null) user = await googleSignIn.signInSilently();
        if (user == null) {
          user = await googleSignIn.signIn();
          analytics.logLogin();
        }
        if (await auth.currentUser() == null) {
          GoogleSignInAuthentication credentials =
              await googleSignIn.currentUser.authentication;
  
          await auth.signInWithGoogle(
            idToken: credentials.idToken,
            accessToken: credentials.accessToken,
          );
        }
        prefs.setString("username", user.displayName);
        prefs.setString("userid", user.id);
        prefs.setString("useremail", user.email);
        prefs.setString("userphotourl", user.photoUrl);
        analytics.logLogin();
        final userRef = FirebaseDatabase.instance.reference().child('Users');
        userRef
            .child(user.id)
            .set({"name": user.displayName, "image": user.photoUrl});
        this.setState(() {
          loggedIn = true;
          _googleLoginProgress = false;
        });
      } catch (error) {
        print(error);
      }
    }
  ....
    @override
    Widget build(BuildContext context) {
      Scaffold.....
  </code></pre>
  
  <p>Compiler message:</p>
  
  <blockquote>
    <p>lib/HomePage.dart:63:20: Error: The method 'signInWithGoogle' isn't
    defined for the class 'FirebaseAuth'.
     - 'FirebaseAuth' is from 'package:firebase_auth/firebase_auth.dart' ('file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.7.0/lib/firebase_auth.dart').
    Try correcting the name to the name of an existing method, or defining
    a method named 'signInWithGoogle'.
            await auth.signInWithGoogle(
                       ^^^^^^^^^^^^^^^^ lib/PostBlogPage.dart:30:16: Error: The method 'signInWithGoogle' isn't defined for the class
    'FirebaseAuth'.
     - 'FirebaseAuth' is from 'package:firebase_auth/firebase_auth.dart' ('file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.7.0/lib/firebase_auth.dart').
    Try correcting the name to the name of an existing method, or defining
    a method named 'signInWithGoogle'.
        await auth.signInWithGoogle(
                   ^^^^^^^^^^^^^^^^ Compiler failed on C:\Users\Ankit\AndroidStudioProjects\blogand\lib\main.dart Finished
    with error: Gradle task assembleDebug failed with exit code 1</p>
  </blockquote>