Ganesh Gudghe
Ganesh Gudghe

Reputation: 1387

Android Google drive API integration unable to add account on debug APK

i have successfully integrated google drive API it work fine on Signed APK

But when try to run it on debug mode it display add account popup window but unable to signin it display error

  ConnectionResult{statusCode=SIGN_IN_REQUIRED,               resolution=PendingIntent{52873b18:
 android.os.BinderProxy@53152a74},
 message=null}

Upvotes: 1

Views: 654

Answers (1)

abielita
abielita

Reputation: 13469

According to the documentation, error SIGN_IN_REQUIRED means that the client attempted to connect to the service but the user is not signed in.

The client attempted to connect to the service but the user is not signed in. The client may choose to continue without using the API. Alternately, if hasResolution() returns true the client may call [startResolutionForResult(Activity, int)](https://developers.google.com/android/reference/com/google/android/gms/common/ConnectionResult#startResolutionForResult(android.app.Activity, int)) to prompt the user to sign in. After the sign in activity returns with RESULT_OK further attempts should succeed.

From this thread, try to use keytool -exportcert -alias androiddebugkey -keystore C:\Users\XXXXX.android\debug.keystore -list -v and not the keystore that you generated since you want the debug mode.

Check these related questions:

Make sure SHA-1 signing-certificate fingerprint of your app in google developers console belong to the same key which is used to sign APK you are testing.

By default, when assembling debug build Android Studio use own debug key. You can change it through right-clicking on the app and selecting "Open Module Settings". Go to "Signing" tab and configure the same key you have mentioned in dev console. After that navigate to the "Build Types" tab and select your signing configuration.

Hope this helps!

Upvotes: 1

Related Questions