How to render <Image /> on React Native on android API 29+

Viewed 354

The issue I have is that since android api version 29+, Android doesn't allow you to read media file with file:///path/to/the/file.jpg so when I try to render images from gallery, I can't render it in the JS side using component from react-native because I can't use uri. Has anyone figured out way to work around?

Edit Here I am trying to render image that is stored in the device and using content resolver with MediaStore Api.

1 Answers

a simple solution is that, make a separate folder and add you all pics in and can simply import it. I am importing images in my project as

enter image description here

    <Image
              style={{width: 66, height: 58}}
              source={require('../assets/truck1.png')} 
/>
Related