-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
net::ERR_FILE_NOT_FOUND when trying to fetch uri of TakePictureResponse #2008
Description
Bug Report
To Do First
- Did you try latest release?
- Did you look for existing matching issues?
Related Modules
RNCamera
Platforms
Android
Description/Current Behaviour
When I run the following:
const picture = await this.camera.takePictureAsync({
exif: true,
doNotSave: false,
});
const fileRetrieve = await fetch(picture.uri);...the last line triggers the following exception (regardless of whether I have the debugger attached or not):
Unhandled promise rejection TypeError: Network request failed
When I have the debugger attached and I'm inspecting network, I also see:
GET file:///data/user/0/com.my.app/cache/Camera/6e499c20-6e3e-4233-becf-12a1d5e381aa.jpg net::ERR_FILE_NOT_FOUND
Expected Behaviour
I expect to have a successful fetch response where I can obtain a Blob reference to my file so that I can use binary apis rather than using memory intensive and less performant base64 strings.
Steps to Reproduce
The code above inside of even the most basic of camera setups is more than sufficient.
I'm not using Expo.
Additionals
I have the following permissions in my AndroidManifest.xml:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />cc.