vapoyan
10/27/2020, 10:49 PMcom.google.android.gms.common.api.ApiException: 10:
I read million of posts about how to fix this issue but was not able to find an answer, basically I did everything in a way how it is explained here:
https://firebase.google.com/docs/auth/android/google-signin#before_you_begin, unfortunately also log message is not telling me much information so I am completely lost.
In my application I have main app
module which is android application and authentication
module which is android library, all my authentication logic is in the library module, I also implemented firebase email password Sign In which is working correct, but when I am trying to do Google Sign In I am getting error, please help.
My activity look like this
class GoogleSignInActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val gso = GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestIdToken(getString(R.string.default_web_client_id))
.requestEmail()
.build()
startActivityForResult(GoogleSignIn.getClient(this, gso).signInIntent,
REQUEST_CODE_GOOGLE_SIGN_IN)
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (requestCode == REQUEST_CODE_GOOGLE_SIGN_IN) {
val task = GoogleSignIn.getSignedInAccountFromIntent(data)
try {
// Google Sign In was successful, authenticate with Firebase
val account = task.getResult(ApiException::class.java)!!
//firebaseAuthWithGoogle(account.idToken!!)
} catch (e: ApiException) {
// Google Sign In failed, update UI appropriately
Log.w("aaa", "Google sign in failed", e)
// ...
}
}
}
companion object {
private const val REQUEST_CODE_GOOGLE_SIGN_IN = 1000
}
}