Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Class GoogleSignIn not found in auth library

I have got problem with signing to Google play by android app, i added: compile 'com.google.firebase:firebase-auth:11.4.2' and compile 'com.google.android.gms:play-services-auth:11.4.2' in my gradle dependencies.
I got only classes like: GoogleSignInApi or GoogleSignInAccount and i dont know how to import others.
I mean classes like GoogleSignIn or GoogleSignInClient. I just dont see them in library.

like image 948
Szymon Gajdzica Avatar asked Nov 07 '17 19:11

Szymon Gajdzica


3 Answers

Here is the release note for version 11.6.0

In Auth Library :

Added the GoogleSignInClient and GoogleSignIn classes. GoogleSignInClient provides the entry point for interacting with the Google Sign In API.

so inject 11.6.0 version of auth artifact.

compile 'com.google.android.gms:play-services-auth:11.6.0'

compile now deprecated so it's better to use implementation

implementation 'com.google.android.gms:play-services-auth:11.6.0'
like image 86
Abhishek Aryan Avatar answered Oct 29 '22 13:10

Abhishek Aryan


GoogleSignIn / GoogleSignInClient were introduced in Google Play services SDK version 11.6.

Older versions have slightly different class names and require a GoogleApiClient.

Please upgrade to 11.6 from Android Studio and configure below dependency.

dependencies {
     compile 'com.google.android.gms:play-services-auth:11.6.0'
 }
like image 23
Isabella Chen Avatar answered Oct 29 '22 12:10

Isabella Chen


  • Update PlayStore lib to latest version 46 from SDK manager->Extra

  • Update all firebase dependencies to 1160

    //Firebase
    compile 'com.google.firebase:firebase-core:11.6.0'
    compile 'com.google.firebase:firebase-auth:11.6.0'
    
  • Update play-services-auth dependencies to 1160

     compile 'com.google.android.gms:play-services-auth:11.6.0'
    
  • Update google-services dependency in project level build.gradle to 3.1.0. Note the maven google dependency:

buildscript {
     repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'
        classpath 'com.google.gms:google-services:3.1.0'
     }
   }

 allprojects {
    repositories {
        jcenter()
        mavenCentral()
        maven { url "https://maven.google.com"}

     }
  }
like image 2
Hitesh Sahu Avatar answered Oct 29 '22 12:10

Hitesh Sahu