Could not write to device, result == -1 errno 0 null
See original GitHub issueHi, @magnusja Libaums version 0.7.3
Hardware devices:
- usb device 1: SanDisk dual-drive 128Gb with Fat32, 32/64 Kb cluster size;
- usb device 2: JetFlash 8Gb with Fat32, 32/4 Kb cluster size;
- android version 9(Samsung Galaxy S10e)/8(Xiaomi Redmi 5 Plus)
Problem
I try to copy about 1000 mixed size/type files (total size 2 Gb).
Expected behavior
Files were copied correctly.
Actual behavior
java.io.IOException: Could not write to device, result == -1 errno 0 null
Stacktrace of Excpetion
Code where problem occurs
UsbFileOutputStream.write(bytes);
Any hints!
Thanks a lot!
Issue Analytics
- State:
- Created 4 years ago
- Comments:63 (20 by maintainers)
Top Results From Across the Web
Could not write to device, result == -1 errno 0 null
Hi, @magnusja. Libaums version 0.7.3. Hardware devices: usb device 1: SanDisk dual-drive 128Gb with Fat32, 32/64 Kb cluster size; ...
Read more >could not write to device result == 1 error 0 null : r/androidapps
I tried to make a bootable flash drive via a otg with iso 2 usb and it just doesn't work!
Read more >android, libaums: java.io.IOException: Could not write to device
I experience a similar error using this library. Instead of using a static buffer size of 1337, there is a method in FileSystem.java...
Read more >Gparted made an error on USB - Super User
Since you can't find a solution with Gparted i suggest using fdisk. Run as sudo: fdisk -l # Make sure your device address...
Read more >libaums/Lobby - Gitter
package com.github.magnusja.libaums.javafs does not exist ... IOException: Could not write to device, result == -1 errno 88 Socket operation on non-socket ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Unfortunately I am out of ideas 😕
I would suggest that you try to debug that on your own and let us know if you have any further insights. Another option is to switch to standard Android file API if your device supports mounting of USB drives out of the box. (Which most of the modern devices should I think)
Hey @kuza2010
thanks a lot for testing. That looks a lot like @Depau 's results, unfortunately 😕
@Depau Cool then I guess I will start playing around with libusb. There is also the
UsbRequest
API which might be worth trying https://github.com/magnusja/libaums/blob/develop/libaums/src/main/java/com/github/mjdev/libaums/usb/UsbRequestCommunication.kt