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.

Share image in android get crash ,and can't Share file directly.

See original GitHub issue
 "react-native": "0.55.3",
 "react-native-share": "^1.0.27",

When I Share image in android get crash , I have already used PermissionsAndroid,.

qq20180505-0

<TouchableOpacity onPress={()=>{
  PermissionsAndroid.request(
    PermissionsAndroid.PERMISSIONS.WRITE_EXTERNAL_STORAGE
  ).then(()=>{
    Share.open(shareImageBase64);
  })
}}>


shareImageBase64 is offer by the demo

When I install react-native-share@1.0.23, this code work. I can share the image by base64, but can’t share file directly.

This code get nothing.

Share.open({url:"file:///1.png"})
1.png is a local image.

Need some help please.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kk412027247commented, Jul 10, 2018

@jgcmarins Dear, I solve this finally.

After following the manual installation of android, and modify this file android/app/src/main/res/xml . I can share image in android now.

<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
    <external-path name="myexternalimages" path="Download/" />
    <root-path name="root" path="" />
</paths>

1reaction
kk412027247commented, May 18, 2018

@jgcmarins yes, just use @1.0.23

Read more comments on GitHub >

github_iconTop Results From Across the Web

Share image in android get crash ,and can't Share file directly.
When I install react-native-share@1.0.23, this code work. I can share the image by base64, but can't share file directly. This code get ......
Read more >
How to use "Share image using" sharing Intent to share ...
How to share image in android progamatically , Sometimes you wants to take a snapshot of your view and then like to share...
Read more >
Sharing Content with Intents | CodePath Android Cliffnotes
Sending Images. To send images or binary data: final Intent shareIntent = new Intent(Intent.ACTION_SEND); shareIntent.setType("image/jpg"); final File ...
Read more >
Sharing a file - Android Developers
Once you have set up your app to share files using content URIs, you can respond to other apps' ... Get the files...
Read more >
The Android app crashes when trying to upload a picture from ...
If I select Gallery, when the pictures open, choosing one causes the app to immediately crash. The circle goes around for about 15...
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