Google Drive API app folder shows no files when using listChildren across different devices

I’m working with Google Drive API for Android to sync app data using the application folder. The backup works fine on a single device, but I’m having issues when trying to access the same data from different devices or after reinstalling the app.

Problem 1: I backup files to the app folder on Device A and can see the storage usage increase in Google Drive settings. When I install the same app on Device B and try to restore the data, the folder appears empty even though the files should be there.

Problem 2: After backing up data successfully and then uninstalling/reinstalling the app on the same device, the app folder shows no files when I try to restore.

I’ve tested both methods to retrieve files:

DriveFolder appFolder = Drive.DriveApi.getAppFolder(googleApiClient);
MetadataBufferResult result = appFolder.queryChildren(googleApiClient, queryFilter).await();

And also:

DriveFolder applicationFolder = Drive.DriveApi.getAppFolder(apiClient);
MetadataBufferResult files = applicationFolder.listChildren(apiClient).await();

Both return empty results even though the Google Drive storage shows my app is using space. Has anyone encountered this issue before?

Yes, the behavior you’re encountering is by design. Google Drive’s app folder is unique to each app based on its package name and signing certificate. When you access the app from a different device or reinstall it, Google treats it as a new instance, resulting in a completely new folder. This is why your app folder appears empty. The storage you notice in Drive settings is cumulative for all versions of the app, but each installation only sees its own isolated data. For effective cross-device synchronization, consider using standard Drive folders instead, but be aware that this will require additional user permissions.

Had this exact problem before. You’re probably using different API credentials between builds. Each Google Drive API project gets its own isolated app folder, so debug and release builds with different OAuth client IDs will see totally different folders - even on the same Google account. Double-check your google-services.json file and make sure you’re using identical project credentials across all builds and devices. The app folder is also tied to your package name and signing certificate combo, so debug builds with different keys create separate spaces.

yeah, might be an auth issue. the app folder is connected to your oauth creds and sig. if you reinstall or switch devices, ensure you have the same signing key and auth setup. also, use the same google account for testing!