7

I have integrated the Google drive sdk with the app and is working fine with the debug and signed build. But, when the app is installed from Play Store it is always showing the Account Chooser popup. Seems like the authentication is getting failed for play store build.

The app's package name and SHA-1 signing-certificate fingerprint is already added in the console.

Did someone faced the same issue during drive sdk integration ?

Shyam
  • 871
  • 6
  • 15
  • 30
  • You may try the workaround in this [thread](https://android.stackexchange.com/questions/92029/google-play-keeps-asking-for-an-account-new-or-existing-and-does-not-start-any) which suggested to Go to settings -> Apps -> Google play then disable the app, uninstall the updates and re-enable it. Also check this [blog](https://appuals.com/authentication-is-required-on-play-store/) which stated that this can be a sync issue, cache issue or an update to Play Store. – abielita Aug 12 '17 at 14:48
  • Thanks for the updates. This is not the issue with play store but with the app having drive sdk integrated. – Shyam Aug 13 '17 at 04:17
  • If its working fine on DEBUG build then you check for any condition in flavours – g7pro Aug 21 '17 at 08:00
  • @Shyam i'm not completely sure but maybe you have to manually hold the user login detail in shared preferences so as to create a session for that user and maybe then it wont ask always for the login – Snehal Gongle Aug 23 '17 at 05:27

3 Answers3

3

Just create an OAuth Client ID in the developers console .This will be worked for you.

  • Already added "OAuth 2.0 client IDs" for both debug and production versions. – Shyam Aug 18 '17 at 08:44
  • Make sure that fingerprint is same from where you created that APK file . Just replace that fingerprint into OAuth Client ID section. – Bloomingsuman Aug 18 '17 at 10:47
  • The finger print in OAuth ID section is same as that of the one used to create production keystore. – Shyam Aug 18 '17 at 12:56
0

I have faced this issue, I was using debug SHA-1 signing-certificate fingerprint even for release apk, you need to update oauth_client client_id id in your google-services.json file with release SHA-1 Key.

For that first get your release SHA-1 key from below command :

-exportcert -alias your_alias_name -keystore your_keystore_path(i.e .jks file path) -list -v

Add SHA-1 of your release key into Google Project Console, then update your google-services.json file.

Hope this should works for you :-)

Bharath Kumar
  • 534
  • 1
  • 7
  • 18
  • Thanks for the reply. I am using the release SHA-1 key in the developer console. And I haven't used google-services.json in the appliccation, as it is not mentioned in the Google tutorial for drive sdk integration. So this is working for me. – Shyam Aug 23 '17 at 07:17
  • @Shyam You're welcome, If this answer was helpful to you, please do upvote, and/or accept it. :-) Happy coding – Bharath Kumar Aug 23 '17 at 07:37
  • @Shyam what is the error now? This is how I placed google-services.json inside my project :: For debug : I placed google-services.json inside src/debug folder with debug key oauth_client For release : placed google-services.json inside src/release folder with release key oauth_client – Bharath Kumar Aug 23 '17 at 07:47
  • In debug mode it is working fine and I'm able to upload/download files from Google drive. Same build is not working in production (Play Store). – Shyam Aug 23 '17 at 09:17
  • I think you have issue in google-services.json in production apk. Can you send your error code from drive-client connection result. – Bharath Kumar Aug 23 '17 at 09:41
0

Okay, I have also had this problem for a couple of weeks now. Turns out, it was Google Play App Signing enabled in Google Play Console. As far as I can tell, it re-signs your APK with its own key, so you have to create separate OAuth Client ID with SHA-1 fingerprint from Google Play Console.

SHA-1 fingerprint can be found in Key Management tab, link to it looks like this: https://play.google.com/apps/publish/?dev_acc=00000000000000000000#KeyManagementPlace:p=com.example

loredan13
  • 114
  • 1
  • 9