jeanpan / react-native-camera-roll-picker

📷 A React Native component providing images selection from camera roll
https://www.npmjs.com/package/react-native-camera-roll-picker
MIT License
423 stars 176 forks source link

IOS: no such file or directory, open 'assets-library://asset/asset.PNG?id=542A24A7-947B-4122-B9C9-CEBA42827A2D&ext=PNG' #71

Closed rajatpillai closed 6 years ago

rajatpillai commented 6 years ago

On IOS, it is displaying all the images but when we select any image it is giving error "no such file or directory, open 'assets-library://asset/asset....."

skipsuva commented 6 years ago

@rajatpillai I've run into a similar issue. Have you seen this closed issue? Seems like it might be a solution for you. https://github.com/jeanpan/react-native-camera-roll-picker/issues/60

rajatpillai commented 6 years ago

I faced this issue while I was converting image into base64 if you are facing the same issue then i solved it by integrating react-native-fetch-blob

example:- import this library : - import RNFetchBlob from 'react-native-fetch-blob';

now use this code for converting image into base64 :- RNFetchBlob.fs.readFile(URI, 'base64') .then((data) => { console.log(data) }) .catch((error) => { console.log(error) })

If this helps you please let me know.

skipsuva commented 6 years ago

@rajatpillai Did that solution also work for Android? I'm using react-native-fs (https://github.com/itinance/react-native-fs) & have iOS working with the copyAssetsFileIOS function it provides...but haven't found something that works with the Android file type.

rajatpillai1 commented 6 years ago

Yes, the above solution works for both Android and IOS.

skipsuva commented 6 years ago

Cool - Turns out my version of RNFS was just out of date and they had added the support for android since. Good talk. @rajatpillai @rajatpillai1 ok to close this issue?

rajatpillai1 commented 6 years ago

Yes Now, this can be closed.