android-credentials icon indicating copy to clipboard operation
android-credentials copied to clipboard

Unexpected response code 400

Open g123k opened this issue 11 years ago • 7 comments

When I try to save the credentials for the first time, I have this message in the logcat:

E/Volley  ( 1070): [250] BasicNetwork.performRequest: Unexpected response code 400 for https://www.googleapis.com/credentials/v1/credentials?alt=proto&header.playServicesVersion=7571000&obfuscationKey=44838BE022CB8E787432945F2B755C422766B72D16B5DDB5CBD56C525143C8AE
E/CredentialsApi( 1309): Error when saving credential.
E/CredentialsApi( 1309): com.google.android.gms.auth.api.credentials.a: java.io.IOException: Server error.
E/CredentialsApi( 1309):    at com.google.android.gms.auth.api.credentials.d.a(SourceFile:329)
E/CredentialsApi( 1309):    at com.google.android.gms.auth.api.credentials.be.b.e.a(SourceFile:181)
E/CredentialsApi( 1309):    at com.google.android.gms.auth.api.credentials.be.b.e.a(SourceFile:33)
E/CredentialsApi( 1309):    at com.google.android.gms.common.service.g.run(SourceFile:178)
E/CredentialsApi( 1309):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
E/CredentialsApi( 1309):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
E/CredentialsApi( 1309):    at java.lang.Thread.run(Thread.java:818)
E/CredentialsApi( 1309): Caused by: java.io.IOException: Server error.
E/CredentialsApi( 1309):    at com.google.android.gms.auth.api.credentials.be.c.d.a(SourceFile:124)
E/CredentialsApi( 1309):    at com.google.android.gms.auth.api.credentials.be.s.a(SourceFile:95)
E/CredentialsApi( 1309):    at com.google.android.gms.auth.api.credentials.be.d.a(SourceFile:279)
E/CredentialsApi( 1309):    at com.google.android.gms.auth.api.credentials.be.d.a(SourceFile:92)
E/CredentialsApi( 1309):    at com.google.android.gms.auth.api.credentials.be.z.onTransact(SourceFile:135)
E/CredentialsApi( 1309):    at android.os.Binder.execTransact(Binder.java:446)
E/CredentialsApi( 1309): Caused by: com.google.android.gms.auth.api.credentials.be.a.c
E/CredentialsApi( 1309):    at com.google.android.gms.auth.api.credentials.be.a.b.a(SourceFile:469)
E/CredentialsApi( 1309):    at com.google.android.gms.auth.api.credentials.be.a.b.a(SourceFile:156)
E/CredentialsApi( 1309):    at com.google.android.gms.auth.api.credentials.be.c.d.a(SourceFile:117)
E/CredentialsApi( 1309):    ... 5 more

I don't think the error is on the client-side, but the Intent in the onActivityResult is empty.

g123k avatar Jun 05 '15 12:06 g123k

@g123k can you show me the code you are using to save credentials? Also have you created a client ID in the Google Developers Console?

samtstern avatar Jun 05 '15 15:06 samtstern

Hello,

I'm using the code from this git. What do you want exactly? And yes, I have a working client ID (the Google sign-in is OK).

g123k avatar Jun 05 '15 15:06 g123k

Hi, any progress here? I see same behavior. What's interesting is that onActivityResult has Activity.RESULT_OK, but in fact the credentials aren't saved.

ValleZ avatar Jun 30 '15 19:06 ValleZ

@ValleZ when you get RESULT_OK are there any errors in the logs?

samtstern avatar Jun 30 '15 20:06 samtstern

Yes, the very same stacktrace - Unexpected response code 400

ValleZ avatar Jun 30 '15 21:06 ValleZ

if building app in a new/different machine then you'll probably need to add a new SHA1 code on Firebase

malcolmmaima avatar Mar 14 '19 07:03 malcolmmaima

I am closing this issue/PR, as it has been migrated to the new repo linked above in the comments. Thank you!

codingjeremy avatar Sep 10 '19 21:09 codingjeremy