21

I'm using the new Google play service drive api to implement backup and restore data with App folder in my android application.I followed the intructions from the google drive developer guides.I can backup and restore data successfully when I only use one device and don't uninstall and reinstall the app.But Problem appears when I use two devices or unintall and reinstall the app.

Scene 1: I install my app on one device and backup data to "App folder" succeed and I can see the data size of my app folder changed in Google drive "Manage apps",then I install my app on another device and try to use "restore from google drive" to restore the data I just backup on the first device.but google drive api returned empty MetadataBuffer.

Scene 2: I install my app on one device and backup data to "App folder" succeed and I also see the data size of my app folder changed in "Manage apps".then I uninstall my app and reinstall it and try to restore the data I backup.the same thing happened.There's no file find in my app folder.

I tried api with both queryChildren and listChildren but no lucky.

Drive.DriveApi.getAppFolder(getGoogleApiClient())
    .queryChildren(getGoogleApiClient(), query)

and

Drive.DriveApi.getAppFolder(mGoogleApiClient).listChildren(mGoogleApiClient)

Can anyone from google drive team resolve the problem? I think it's a really big bug.we still have no resolve method.

robert
  • 540
  • 2
  • 12
  • 1
    Duplicate of http://stackoverflow.com/questions/23755346/android-google-drive-app-data-folder-not-listing-all-childrens? – Dan McGrath May 28 '14 at 17:02
  • Yes,You're right.It seems like that we have the same problem. – robert May 29 '14 at 09:40
  • Some one said use Drive.DriveApi.requestSync(getGoogleApiClient) can solve the problem.I've tried it but still with no lucky. – robert Jun 02 '14 at 02:20
  • Can anyone from google drive team resolve the problem? I think it's a really big bug.we still have no resolve method. – robert Jun 09 '14 at 01:25
  • In the documentation they say "Your App Folder is deleted if users uninstall your app from their Drive. They can also delete your app's App Folder manually using the Options menu in the Manage Apps dialog", [Drive Docs](https://developers.google.com/drive/android/appfolder) – Cristofor Jul 04 '14 at 21:32
  • @CristianYes,You are right,but It's not same with my scenes.You should read my question description again.User didn't delete my app's App Folder or uninstall my app from Web Google Drive. – robert Jul 06 '14 at 08:33
  • Hello Robert, did you get a solution in the end? I am now facing the same problem... – Qianqian Sep 30 '14 at 01:58
  • @Qianqian I solved the problem by use the old google driver api instead of google drive api included in google play service. – robert Oct 09 '14 at 09:19

1 Answers1

4

We have identified an issue with the API that meant App Folder content was not downloaded after an app was uninstalled then reinstalled. This will be fixed in the next release of Google Play services.

For development purposes, you can work around this issue in the current Google Play services (version 6.1) by clearing Google Play services data (Settings > Apps > Google Play services > Manage Space > Clear all data). We don't recommend suggesting this solution to end users as this will likely clear data relied on by other apps.

Regards,
Daniel

Daniel
  • 1,239
  • 1
  • 13
  • 24
  • 1
    A year has passed and this annoying bug is still unresolved... You should at least update your documentation to save some frustration and programmers time – stevo.mit Dec 05 '15 at 16:09
  • The bug referenced here was resolved in a previous release of Play services. If you're encountering a similar issue, could you please file a bug - see: https://code.google.com/a/google.com/p/apps-api-issues/ – Daniel Dec 06 '15 at 00:21
  • 2
    In which version of Google Play Services this problem was resolved? In version `8.3.0` the problem still not resoved – ArtKorchagin Dec 11 '15 at 11:33
  • I can confirm that with google play services 8.3.0 the problem is still there. – greywolf82 Dec 27 '15 at 17:00
  • 1
    I couldn't remember when it was fixed, but I did found it fixed some time ago and happily adopted the code. However, today when I tried to update my app and did the testing, it was broken again with current Play service (version 8.4.0). Frustrated and exhausted. – Qianqian Jan 23 '16 at 22:10
  • It's broken. My Play Services Version is 12.6.85 – Koushik Shom Choudhury Jun 17 '18 at 03:16