I'm using Firebase Authentication in my Android app. Recently, I have formatted my PC and installed Ubuntu 18.04 LTS (It has Ubuntu 16 installed before the format), and after I installed Android Studio and tried the app, the Google sign in was not working, there is an ApiException
thrown on those two lines:
GoogleSignInAccount account = task.getResult(ApiException.class);
firebaseAuthWithGoogle(account);
The stack trace:
com.google.android.gms.common.api.ApiException: 10:
at com.google.android.gms.common.internal.ApiExceptionUtil.fromStatus(Unknown Source)
at com.google.android.gms.auth.api.signin.GoogleSignIn.getSignedInAccountFromIntent(Unknown Source)
at com.game.ameer.ta7adialma3rifa.fragments.login.LoginFragment.onActivityResult(LoginFragment.java:220)
at android.support.v4.app.FragmentActivity.onActivityResult(FragmentActivity.java:151)
at com.game.ameer.ta7adialma3rifa.activities.LoginActivity.onActivityResult(LoginActivity.java:38)
at android.app.Activity.dispatchActivityResult(Activity.java:7303)
at android.app.ActivityThread.deliverResults(ActivityThread.java:4516)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:4563)
at android.app.ActivityThread.-wrap22(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1698)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6776)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1518)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)
This didn't happen before I format the PC, and I believe that the problem is not in the code but in Firebase configuration, with some sort of token or certificate. What is causing the problem? And how to solve it?