kuatsu / react-native-cloud-storage

☁️ Save to & read from iCloud and Google Drive using React Native
https://react-native-cloud-storage.oss.kuatsu.de/docs/intro
MIT License
141 stars 10 forks source link

Cannot create root folder on Android #24

Open cip123 opened 10 months ago

cip123 commented 10 months ago

Describe the bug If I try to create the root folder on Android with

await CloudStorage.writeFile("/", "", CloudStorageScope.AppData);

it is not created, and I still get an error related to the missing root folder next time I verify if it exists.

The work around this is to create a file in that folder:

await CloudStorage.writeFile("/.keep", "", CloudStorageScope.AppData);
mfkrause commented 10 months ago

I can confirm / reproduce, but will have to investigate this a little deeper first. Once a file has been created, deleting it (emptying the directory) also leads to the root directory not being found anymore, at least for the AppData scope. This might be expected behavior by the Google Drive API, so I'll have to see if I can work around this.

For now, you can simply ignore the library saying the AppData directory doesn't exist and safely perform file operations within (as you correctly noticed already with your workaround).

github-actions[bot] commented 8 months ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.