I'm using rn-fetch-blob 0.10.8 with RN 0.49 on iOS with iPhone 6 Simulator.
I'm using the react-native-image-resizer module to resize an image and then I use react-native-fetch-blob to move that image to the right location. However, when doing so I'm getting the error:
The file “6492238E-AAAC-4DC6-90F3-AFAB7225DBD5.jpg” couldn’t be opened because there is no such file.
Before doing the copy, I'm printing the source and destination to the console:
"Moving file:///Users/laurent/Library/Developer/CoreSimulator/Devices/3AF6C788-B6ED-41DD-85F0-32D719DB0DBE/data/Containers/Data/Application/A401D341-9C60-4AA3-8D8F-69207A8C9454/Library/Caches/6492238E-AAAC-4DC6-90F3-AFAB7225DBD5.jpg => /Users/laurent/Library/Developer/CoreSimulator/Devices/3AF6C788-B6ED-41DD-85F0-32D719DB0DBE/data/Containers/Data/Application/A401D341-9C60-4AA3-8D8F-69207A8C9454/Documents/testing.jpg"
I can verify that the path //Users/laurent/Library/Developer/CoreSimulator/Devices/3AF6C788-B6ED-41DD-85F0-32D719DB0DBE/data/Containers/Data/Application/A401D341-9C60-4AA3-8D8F-69207A8C9454/Library/Caches/6492238E-AAAC-4DC6-90F3-AFAB7225DBD5.jpg
exist as I can open it in Finder. However for some reason rn-fetch-blob doesn't find it.
Any idea what could be the issue?
For information this the code I'm using:
const resizedImage = await ImageResizer.createResizedImage(localFilePath, dimensions.width, dimensions.height, format, 85);
const resizedImagePath = resizedImage.uri;
console.info('Moving ' + resizedImagePath + ' => ' + targetPath);
await RNFetchBlob.fs.cp(resizedImagePath, targetPath); // Throws error