Logon Error 12500

I am trying to integrate Google Sign In into my application. I don’t have a server server, I just get information about a registered Google account in my application.

At first I tried it using the Google Login Example , but I got an error (there were no code changes except for printing the stack). I just used the SignInActivity example, since I do not have a server server.

Exception com.google.android.gms.common.api.ApiException: 12500: at com.google.android.gms.common.internal.zzb.zzz(Unknown Source) at com.google.android.gms.auth.api.signin.GoogleSignIn.getSignedInAccountFromIntent(Unknown Source) at com.ewise.android.api.MainActivity.onActivityResult(SignInActivity.java:89) at android.app.Activity.dispatchActivityResult(Activity.java:7010) at android.app.ActivityThread.deliverResults(ActivityThread.java:4187) at android.app.ActivityThread.handleSendResult(ActivityThread.java:4234) at android.app.ActivityThread.-wrap20(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1584) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6316) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:872) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762) 

code

  public class SignInActivity extends AppCompatActivity implements View.OnClickListener { private static final String TAG = "SignInActivity"; private static final int RC_SIGN_IN = 9001; private GoogleSignInClient mGoogleSignInClient; private TextView mStatusTextView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Views mStatusTextView = findViewById(R.id.status); // Button listeners findViewById(R.id.sign_in_button).setOnClickListener(this); findViewById(R.id.sign_out_button).setOnClickListener(this); findViewById(R.id.disconnect_button).setOnClickListener(this); // [START configure_signin] // Configure sign-in to request the user ID, email address, and basic // profile. ID and basic profile are included in DEFAULT_SIGN_IN. GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .requestEmail() .build(); // [END configure_signin] // [START build_client] // Build a GoogleSignInClient with the options specified by gso. mGoogleSignInClient = GoogleSignIn.getClient(this, gso); // [END build_client] // [START customize_button] // Set the dimensions of the sign-in button. SignInButton signInButton = findViewById(R.id.sign_in_button); signInButton.setSize(SignInButton.SIZE_STANDARD); signInButton.setColorScheme(SignInButton.COLOR_LIGHT); // [END customize_button] } @Override public void onStart() { super.onStart(); // [START on_start_sign_in] // Check for existing Google Sign In account, if the user is already signed in // the GoogleSignInAccount will be non-null. GoogleSignInAccount account = GoogleSignIn.getLastSignedInAccount(this); updateUI(account); // [END on_start_sign_in] } // [START onActivityResult] @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); // Result returned from launching the Intent from GoogleSignInClient.getSignInIntent(...); if (requestCode == RC_SIGN_IN) { // The Task returned from this call is always completed, no need to attach // a listener. Task<GoogleSignInAccount> task = GoogleSignIn.getSignedInAccountFromIntent(data); handleSignInResult(task); } } // [END onActivityResult] // [START handleSignInResult] private void handleSignInResult(Task<GoogleSignInAccount> completedTask) { try { GoogleSignInAccount account = completedTask.getResult(ApiException.class); // Signed in successfully, show authenticated UI. updateUI(account); } catch (ApiException e) { // The ApiException status code indicates the detailed failure reason. // Please refer to the GoogleSignInStatusCodes class reference for more information. Log.w(TAG, "signInResult:failed code=" + e.getStatusCode()); e.printStackTrace(); updateUI(null); } } // [END handleSignInResult] // [START signIn] private void signIn() { Intent signInIntent = mGoogleSignInClient.getSignInIntent(); startActivityForResult(signInIntent, RC_SIGN_IN); } // [END signIn] // [START signOut] private void signOut() { mGoogleSignInClient.signOut() .addOnCompleteListener(this, new OnCompleteListener<Void>() { @Override public void onComplete(@NonNull Task<Void> task) { // [START_EXCLUDE] updateUI(null); // [END_EXCLUDE] } }); } // [END signOut] // [START revokeAccess] private void revokeAccess() { mGoogleSignInClient.revokeAccess() .addOnCompleteListener(this, new OnCompleteListener<Void>() { @Override public void onComplete(@NonNull Task<Void> task) { // [START_EXCLUDE] updateUI(null); // [END_EXCLUDE] } }); } // [END revokeAccess] private void updateUI(@Nullable GoogleSignInAccount account) { if (account != null) { mStatusTextView.setText(getString(R.string.signed_in_fmt, account.getDisplayName())); findViewById(R.id.sign_in_button).setVisibility(View.GONE); findViewById(R.id.sign_out_and_disconnect).setVisibility(View.VISIBLE); } else { mStatusTextView.setText(R.string.signed_out); findViewById(R.id.sign_in_button).setVisibility(View.VISIBLE); findViewById(R.id.sign_out_and_disconnect).setVisibility(View.GONE); } } @Override public void onClick(View v) { switch (v.getId()) { case R.id.sign_in_button: signIn(); break; case R.id.sign_out_button: signOut(); break; case R.id.disconnect_button: revokeAccess(); break; } } } 

From what I read, the problem could be caused by SHA1 Generation .

I followed the complete guide , but apparently it doesn't work.

I copied SHA1 from gradle signedReport

 Variant: debug Config: debug Store: /Users/user/.android/debug.keystore Alias: AndroidDebugKey MD5: A3:16:3F:43:75:FE:07:62:6D:8D:CC:DD:21:9F:FA:1A SHA1: 7B:21:26:7F:D8:18:BB:0E:36:1C:82:DD:B7:28:5F:C1:2F:5C:E4:EA Valid until: Saturday, August 31, 2047 ---------- Variant: release Config: none ---------- Variant: debugAndroidTest Config: debug Store: /Users/user/.android/debug.keystore Alias: AndroidDebugKey MD5: A3:16:3F:43:75:FE:07:62:6D:8D:CC:DD:21:9F:FA:1A SHA1: 7B:21:26:7F:D8:18:BB:0E:36:1C:82:DD:B7:28:5F:C1:2F:5C:E4:EA Valid until: Saturday, August 31, 2047 ---------- Variant: debugUnitTest Config: debug Store: /Users/user/.android/debug.keystore Alias: AndroidDebugKey MD5: A3:16:3F:43:75:FE:07:62:6D:8D:CC:DD:21:9F:FA:1A SHA1: 7B:21:26:7F:D8:18:BB:0E:36:1C:82:DD:B7:28:5F:C1:2F:5C:E4:EA Valid until: Saturday, August 31, 2047 

what could be the reason for this?

thanks

PS Could this be a possible cause?

 Google Play services out of date. Requires 11720000 but found 10932470 
+80
source share
29 answers

Just upgrade your Google Play Services to the latest version (or 1,172,000 in this case). If you use AVD, Nexus 5 and 5X images support Google Play. After starting the emulator, go to the menu of advanced controls> Google Play, then update.

+31
source

PlatformException error (sign_in_failed, com.google.android.gms.common.api.ApiException: 12500 :, zero)

This error 12500 can be fixed by adding the support email address to your project in the project settings. Open the link https://console.firebase.google.com/

Select your project and open the settings tab.

Enter a valid support email address and restart the application.

enter image description here

+43
source

Check if SHA-1 fingerprints have been added to the Firebase project settings. If not, find the SHA-1 fingerprint using

https://developers.google.com/android/guides/client-auth

Also find the SHA-1 unlock key fingerprint using

 keytool -list -v -keystore <keystore path> 

Delete the <keystore path> along with the <keystore path> .

Then add both SHA-1 fingerprints to your Firebase project settings.

NB. Remember to replace google-services.json with the updated google-services.json with new fingerprints. I lost two days on this.

While debugging

Android Studio automatically generates ~/.android/debug.keystore when you first build debugging and uses it to sign the application.

To start SHA-1 ( android password) ( doc ):

 keytool -exportcert -list -v -alias androiddebugkey -keystore ~/.android/debug.keystore 

This SHA-1 should be added to the application settings on firebase to enable the use of Google login capabilities when testing a debug build.

+36
source

for error 12500, you need to add gmail support only in the firebase settings, and for error 10 add the ssh fingerprint in the firebase console, as shown in the figure

+32
source

For Google SignIn to work, you need email support, as well as all project links and privacy , otherwise 12500 will be issued.

Install it at https://console.developers.google.com/apis/credentials

This is not mentioned anywhere in the Firebase tutorials.

+25
source

Try updating the OAuth consent screen at https://console.developers.google.com/apis/credentials.

+17
source

I got stuck for a while.

Make sure these steps are performed-

  • The correct SHA key is stored on the Firebase console.
  • Download the latest version of google-service.json
  • And the last and most important thing is to maintain OAuth consent under credentials in google api, OAuth Screen. To understand this, it took a long time. And after that, everything worked fine.
+14
source

Your SHA1 seems to be overwritten by the Google Play Store. Check in your Google Play store, the launchpad, under the signature of the application, see if there is an additional SHA1 added on Google Play.

And copy that SHA1, add to your appropriate place, will do the job.

+10
source

I use Firebase Authentication. My SHA-1 was specified correctly, the client ID was also correct, but I was still getting 12500.

It turned out that my problem was that I did not specify the support email address in the settings of my project. (Settings β†’ General tab β†’ section Your project (General settings)).

+5
source

If there is someone else with a similar problem, if you are adding custom areas, make sure that this is a valid area. In my case, I mixed the areas of Facebook and Google, and it took me a while to figure this out!

+4
source

Go to your project in the Firebase console, open the "Project Settings" and add the fingerprints of your SHA certificates there. Download the updated google-services.json file and add it to the Projects application folder.

It worked for me.

Firebase console screenshots

+4
source

First, make sure you register your application in the Google Developer Console.

Make sure your Firebase application has debug and release keys. If this error appears in a production environment, add your SHA-1 release key to the base application. If it appears in development, add your SHA-1 debug key .

Where to add SHA-1 finger print

Getting the debug / release key:

 keytool -exportcert -list -v -alias [your alias] -keystore [path/to/debug or release.keystore] 

Download the updated google-services.json to your application.

+3
source

For me, the problem was using ClientID 'release' with my debugging application. Make sure you have release and debug keys using each SHA-1 accordingly.

+2
source

I think the error came from the wrong SHA1. Please do not forget that SHA1 is different between release and debug mode in android studio. Instead of using keytool to get SHA1, you can use the Gradle -> Task -> android -> signatureReport project in android studio (you can open it using the menu View -> Toolwindow -> gradle) to get SHA1 release and debugging. After that, for ease of operation, you need to create 2 separate credentials with two SHA1s on the Google Cloud Console (Google just instructs to create 1 using the SHA1 release, when we develop it, it will not work because it uses debugging SHA1).

+2
source

It may also happen that the cordova compiler will not be able to find the desired keystore file.



Solution: before executing ionic cordova build android specify signature properties

Step 1 : generate a debug key store file

Run command

 keytool -exportcert -list -v -alias androiddebugkey -keystore ~/.android/debug.keystore 

Use password: android

Step 2: Copy the keystore file ( debug.keystore ) from ~/.android to ~/.android platform/android your current project

Step 3: Create a file called release-signing.properties in the platform/android directory

Step 4: Add Content To File

 storeFile=debug.keystore keyAlias=androiddebugkey storePassword=android keyPassword=android 

Note. These are the default values. If you provided your alias and password, use them accordingly.

Step 5: now build the ionic cordova build android

+1
source

I had the same problem after opening a project on another computer (in another Android Studio). In my case, I solved this with the Firebase Assistant, which I used to initially configure Firebase. Open the Firebase Assistant (Tools> Firebase) and select Authentication> Connect. This reconnected the project to Firebase and updated the configs.

+1
source

When your application authenticates with the backend server or accesses the Google APIs from your backend server, you must pass the OAuth 2.0 client ID created for your server to the requestIdToken method when creating the GoogleSignInOptions object to access basic user profile information . and then remember to send an email to support at the OAuth consent screen, which is located on the credentials page in the API console.

+1
source

I’ve been stuck in the problem of logging in to Google since 2 weeks, I finally got it right. Let me explain the reason. The problem was with the fire base. At Firebase, they referred to the "email support" field as optional. But as soon as I added it (any of your personal letters), the problem was resolved, and I received an answer. If you receive error 12501, then this is due to the settings in your Google account.

+1
source

If you came here from flutter : this is one of the key cases that we must fix according to the documentation here: https://pub.dev/packages/google_sign_in enter image description here

enter image description here

  • Then look for the Google Peoples API

enter image description here

  • Open the Google People API map and click "Enable", your application can get rid of this problem.
+1
source

In my case, this is due to an incorrect Google client ID. I change my key to the key specified in google-services.json (under the oauth_client object)

0
source

Make sure you configure the following things correctly:

  1. Generate a customer ID in your Google project.
  2. Specify the correct SHA-1 key for this client ID. (debug / release)
  3. Specify the correct package name for this customer ID.
  4. Make sure you generate the client ID in the strings.xml , google-services.json or credentials.json file.
0
source

https://developers.google.com/identity/sign-in/android/sign-in follow this API documentation, but keep in mind that the WEB_CLIENT_ID uses the client identifier value that is created in google-services.json.

 class MainActivity : AppCompatActivity(), GoogleApiClient.OnConnectionFailedListener { private val TAG = "JSAGoogleSignIn" private val REQUEST_CODE_SIGN_IN = 1234 private val WEB_CLIENT_ID = "354298333018-XXXXXXXXXXXXXXXXXXXXXXX.apps.googleusercontent.com" private var mAuth: FirebaseAuth? = null private var mGoogleApiClient: GoogleApiClient? = null override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) var txt_register = findViewById<TextView>(R.id.txt_register) txt_register.setOnClickListener { var intent = Intent( this@MainActivity , RegisterActivity::class.java) finish() startActivity(intent) } val gso = GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .requestIdToken(WEB_CLIENT_ID) .requestEmail() .build() mGoogleApiClient = GoogleApiClient.Builder(this) .enableAutoManage(this /* FragmentActivity */, this /* OnConnectionFailedListener */) .addApi(Auth.GOOGLE_SIGN_IN_API, gso) .build() mAuth = FirebaseAuth.getInstance() sign_in_button.setOnClickListener { val intent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient) startActivityForResult(intent, REQUEST_CODE_SIGN_IN) } } override fun onConnectionFailed(p0: ConnectionResult) { TODO("not implemented") //To change body of created functions use File | Settings | File Templates. } private fun updateUI(user: FirebaseUser?) { if (user != null) { Log.e("Email", "Value" + user.email) } } fun signIn() { } override fun onStart() { super.onStart() val currentUser = mAuth!!.currentUser updateUI(currentUser) } public override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) // Result returned from launching the Intent from GoogleSignInClient.getSignInIntent(...); if (requestCode == REQUEST_CODE_SIGN_IN) { val result = Auth.GoogleSignInApi.getSignInResultFromIntent(data) if (result.isSuccess) { // successful -> authenticate with Firebase val account = result.signInAccount firebaseAuthWithGoogle(account!!) } else { // failed -> update UI updateUI(null) Toast.makeText(applicationContext, "SignIn: failed!" + result.status, Toast.LENGTH_SHORT).show() } } } private fun firebaseAuthWithGoogle(acct: GoogleSignInAccount) { Log.e(TAG, "firebaseAuthWithGoogle():" + acct.id!!) val credential = GoogleAuthProvider.getCredential(acct.idToken, null) mAuth!!.signInWithCredential(credential) .addOnCompleteListener(this) { task -> if (task.isSuccessful) { // Sign in success Log.e(TAG, "signInWithCredential: Success!") val user = mAuth!!.currentUser updateUI(user) } else { // Sign in fails Log.w(TAG, "signInWithCredential: Failed!", task.exception) Toast.makeText(applicationContext, "Authentication failed!", Toast.LENGTH_SHORT).show() updateUI(null) } } } 
0
source

In my case, after adding the fingerprint to the Firebase console, it is automatically selected by the Google developers console and shows the fingerprints. But to enter failed. After looking at every step, I realized that Google canceled my manifest file package, like this com.xxxxxxxx.app . But this is actually app.xxxxxxxx.com , in the Google Developer Console. Therefore, I deleted the automatically generated fingerprint and added the fingerprint with the correct package name. BOOM !!. It worked.

0
source

I got an error when the Google option was not turned on, as shown in the figure .

This happened when I changed my Google account and forgot to enable the option to connect to Google.

0
source

The last 4 days, login to Google does not work, I tried all the solutions in this post, but to no avail. PS: login worked 1 week ago.

0
source

Make sure your project should not contain any special characters, including numeric or any other characters (the project name should be simple, for example, com.google.testproject).

0
source

In my case, I was working on a non-production application, the problem was that when creating the project in the Firebase console, there were problems synchronizing the SHA-1 keys back and forth from the Firebase & Google Developer Console. Therefore, I decided to first create a project in the Google developer console, and then select it when creating a new project in the Firebase console.

I also made a tutorial for this that can help you.

0
source

Try the following options:

 keytool -list -v -keystore C:\Users\MG\Desktop\test.jks -alias test 

It asks for a password and just enter the password. You can see the fingerprints of SHA1, MD5.

enter image description here

-1
source

My solution: (edit: January 04/2019) enter image description here

enter image description here

enter image description here

-1
source

Source: https://habr.com/ru/post/1273839/


All Articles