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.

java.io.IOException: write failed: EPIPE (Broken pipe)

See original GitHub issue

I get the following error trying to share a file from the assets folder:

E/TransferOutThread: Exception transferring file
E/TransferOutThread: java.io.IOException: write failed: EPIPE (Broken pipe)
E/TransferOutThread:     at libcore.io.IoBridge.write(IoBridge.java:542)
E/TransferOutThread:     at java.io.FileOutputStream.write(FileOutputStream.java:186)
E/TransferOutThread:     at com.commonsware.cwac.provider.AbstractPipeStrategy$TransferOutThread.run(AbstractPipeStrategy.java:96)
E/TransferOutThread:  Caused by: android.system.ErrnoException: write failed: EPIPE (Broken pipe)
E/TransferOutThread:     at libcore.io.Posix.writeBytes(Native Method)
E/TransferOutThread:     at libcore.io.Posix.write(Posix.java:258)
E/TransferOutThread:     at libcore.io.BlockGuardOs.write(BlockGuardOs.java:313)
E/TransferOutThread:     at libcore.io.IoBridge.write(IoBridge.java:537)
E/TransferOutThread:     at java.io.FileOutputStream.write(FileOutputStream.java:186) 
E/TransferOutThread:     at com.commonsware.cwac.provider.AbstractPipeStrategy$TransferOutThread.run(AbstractPipeStrategy.java:96) 

The file exists, I’ve tried sending a non-existent file and the error was a FileNotFoundException. I think I’m creating the Intent and everything correctly, but I paste it here anyway:

Intent share = new Intent(Intent.ACTION_SEND);
share.setType("audio/*");
share.putExtra(Intent.EXTRA_STREAM, PROVIDER.buildUpon().appendPath(soundName + ".mp3").build());
share.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
startActivity(Intent.createChooser(share, "Share audio"));

I’m using the last version of cwac-provider, with Android sdkVersion 23

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
jjosebacommented, Nov 15, 2015

I’ve isolated the problem to the simplest code. It’s just an Activity that launches the sharing intent in its onStart() method. I’ve uploaded the complete project here: https://drive.google.com/file/d/0ByCtNqXoOZUEaTNDU3M0V3JRMmc/view?usp=sharing

0reactions
commonsguycommented, Nov 25, 2015

With regards to Telegram, as I don’t use it, I don’t have a great way of testing it specifically. You might try a test with a file:/// with the same content; it’s possible that Telegram is fine with the Uri but just doesn’t like the content for some reason. If you come up with fresh evidence, or a way for me to test this that doesn’t involve me signing up for Telegram, file a fresh issue.

With respect to the docs, I just pushed a fix – thanks for pointing that out!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android: write failed: EPIPE (Broken pipe) Error on write file
You are trying to use a system command from /system/bin. I assume you'd need root permissions to invoke that on the emulator. But...
Read more >
Printing Error: Broken pipe (Write failed) - Oracle Support
Symptoms. When attempting to print a BI publisher report, the following error occurs: Document delivery failed. Error deliver document to ...
Read more >
Android Question Running iptables script - B4X
I almos try creating a java lib for this, to run the script. but no lock. ... java.io.IOException: write failed: EPIPE (Broken pipe)...
Read more >
Broken Pipe Error in Python - GeeksforGeeks
A broken Pipe Error is generally an Input/Output Error, which is occurred at the Linux System level. The error has occurred during the...
Read more >
Root access on adb shell but not for apps - XDA Forums
When i am trying to call a root shell command from my app i am getting: [java.io.IOException] : write failed: EPIPE (Broken pipe)....
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