Closed tomreich closed 4 years ago
Nothing to see here, folks. My Xamarin Forms reference in my app was pretty far out of date so I updated to the latest version and the issue seems to have resolved. Should anyone else encounter something similar, make sure you all your NuGet packages are up to date!
Glad to hear that your issue was resolved. It is very strange, though, that reading from a ContentProvider may skip bytes in the file...
Got a headscratcher here for you. I'm picking zip files and using GetStream() to get the file contents. On all Android 9 and below devices I've tested, it's working fine with no issues. On Android 10, the stream consistently gets corrupted -- eventually, bytes in the stream start to disappear. I've tried on multiple devices with multiple files (ranging from 10mb up to 50) and this consistently seems to happen.
To repro this, I've got a valid ~43mb zip file called inputfile.zip. I copied this file to the Android 10 device and used the code below to pick it using FilePicker and copy the stream to a new file, outputfile.zip. I then extracted outputfile.zip from the android device and noted that it is corrupt. Interestingly, both inputfile.zip and outputfile.zip have the same byte count (45499125 - see screenshot) but if I run a binary diff on both files, you can see around location 02AF 98C0, the hex "EC" mysteriously goes missing (see screenshot).
I've also tried a similar test using DataBytes rather than GetStream() and I get a similar result.
Expected Behavior
inputfile.zip and outputfile.zip are identical.
Actual Behavior
Missing bytes (in this example around location 02AF 98C0)
Steps to Reproduce the Problem
Specifications