question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could not write to device, result == -1 errno 0 null

See original GitHub issue

Hi, @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

image

Code where problem occurs

UsbFileOutputStream.write(bytes);

Any hints!

Thanks a lot!

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:63 (20 by maintainers)

github_iconTop GitHub Comments

1reaction
magnusjacommented, Feb 21, 2020

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)

1reaction
magnusjacommented, Jan 10, 2020

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found