Hi am trying to access image in assets/images/flower.png Am using react-native-fs
but I tried different path but no luck. has anyone did this before and succeeded ?
var RNFS = require("react-native-fs");
this.base64RouteImage = await RNFS.readFile(
"../../../assets/images/flower.png",
"base64"
).then();
console.log("64 is " + base64data);
I tried below different path as below
/images/flower.png
app/assets/images/flower.png
/app/assets/images/flower.png
file://app/assets/images/flower.png
./assets/images/flower.png
import Flower from "../../../assets/images/flower.png";
../../../assets/images/flower.png
EDIT 1
I have added permission read/write internal/external permission in android
EDIT 2
I tried
RNFS.DocumentDirectoryPath + "/assets/images/flower.png"
but it says
error: ENOENT: /data/user/0/com.tipll/files/assets/images/flower.png (No such file or directory)
I need to access the images in react-native assets folder app/assets/images/flower.png
Still no luck
EDIT 3
my path reference from my current screen is like ../../../assets/images/flower.png
EDIT 4
EDIT 5
Am trying to access image from app/views/routes/view/Flower.js
this Flower.js screen.
Any help will be appreciated.
Thanks in advance