Я исправил ошибку, обновив версию сервисов Google play с помощью этого кода,
//On button click of the google signIn
googleSignIn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent signInIntent = mGoogleSignInClient.getSignInIntent();
startActivityForResult(signInIntent,GOOGLE_SIGNIN_ID);
}
//onActivity Result code.
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent
data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == GOOGLE_SIGNIN_ID){
Task<GoogleSignInAccount> googleSignInAccountTask = GoogleSignIn.getSignedInAccountFromIntent(data);
try {
GoogleSignInAccount googleSignInAccount = googleSignInAccountTask.getResult(ApiException.class);
fireBaseAuthenticationWithGoogle(googleSignInAccount);
}catch (ApiException e){
//if user doesn't have updated google play services version
if (e.getStatusCode() == 12500){
try{
// show your own AlertDialog for example:
AlertDialog.Builder builder = new AlertDialog.Builder(this);
// set the message
builder.setMessage("This app uses google play services for signing in")
.setTitle("Do you want to update?");
builder.setPositiveButton("Ok", (dialog, id) -> {
//final String appPackageName = "com.google.android.gms";
final String appPackageName = "com.google.android.gms&hl=en_IN";
try {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName)));
}catch (android.content.ActivityNotFoundException anfe) {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + appPackageName)));
}
});
builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// User cancelled the dialog
}
});
AlertDialog dialog = builder.create();
dialog.show();
}catch (Exception err){
err.printStackTrace();
}
}
}
}
поместите его туда, где вы получили исключение.Надеюсь, это поможет @ matdev.