react-native-view-shot icon indicating copy to clipboard operation
react-native-view-shot copied to clipboard

Shot sometimes saved on /storage/emulated/0 on Android

Open outaTiME opened this issue 5 years ago • 0 comments

Hi guys, im using Expo SDK 37 with react-native-view-shot 3.1.2 and im getting into wired issue, "some" of my android users expecting the following error when capture screenshot:

Error: Failed to share the file: Failed to find configured root that contains /storage/emulated/0/Android/data/im.outa.AmbitoDolar/cache/ReactNative-snapshot-image6993239015783902665.png
  at value ([native code])
  at value ([native code])

this happens sporadically and I have no idea why 😢

here the snippet from my code:

captureRef(shareViewContainerRef.current, {
  // opts
}).then(
  (uri) => {
    Sharing.shareAsync('file://' + uri);
  },
  (error) =>
    console.error('Unable to generate snapshot', error)
);

its /storage/emulated/0 directory an valid temporary files? i need some extra android permission to read that file?

This is one of the devices that throws an error:

I remind you that this only happens with some androids, any advice will be welcome, thanks !!!

outaTiME avatar Jun 16 '20 16:06 outaTiME