googleworkspace / android-samples

Android samples for Google Workspace APIs
Apache License 2.0
635 stars 410 forks source link

0 byte files when uploading files using SAF #109

Closed aleripe closed 5 years ago

aleripe commented 5 years ago

I'm migrating my Android app off the deprecated Drive Android API as suggested here https://developers.google.com/drive/android/deprecation. I've opted to use the Storage Access Framework to meet my requirement, however I'm seeing odd behaviour from Drive's (Android app) content provider. When saving files, I'm constantly seeing files saved with 0 bytes (quite often works the first time, then intermittently afterwards - same content written). Remote files are never fetched, resulting in...

java.io.FileNotFoundException: StorageFileLoadException[io_error]
    at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(DatabaseUtils.java:144)
    at android.content.ContentProviderProxy.openTypedAssetFile(ContentProviderNative.java:698)
    at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1458)
    at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1295)
    at android.content.ContentResolver.openInputStream(ContentResolver.java:1015)

Please help!

sqrrrl commented 5 years ago

Thanks for inquiring. Unfortunately this issue tracker is only for reporting issues with the particular samples. For general help, I suggest StackOverflow or one of the other support resources at https://developer.android.com/support.

aleripe commented 5 years ago

This sample shows the same exact behavior so I don't know how it could be off topic...