React-native-fetch-blob: File descriptor closed In android version 5 ?

Created on 30 Nov 2017  路  1Comment  路  Source: wkh237/react-native-fetch-blob

Hi, i am using react native fetch blob for uploading image in backend(hapijs),
The plugin, when used in android version 6 works pretty well, but when it comes to use in android version 5 , it throws up an error ("File descriptor closed") & moreover it tends to take up a lot of time to upload the form data

issue i am facing ==> File descriptor closed console.warn @ YellowBox.js:78

  • please provide the version of installed library and RN project.
    "react": "16.0.0-beta.5",
    "react-native": "0.49.5",
    "react-native-fetch-blob": "^0.10.8",
  • a sample code snippet/repository is very helpful to spotting the problem.

RNFetchBlob.fetch('POST', BACKEND_URL+"/api/User/imageUpload", {
'Content-Type' : 'multipart/form-data',
}, [
{ name: 'imageLink', filename: 'AE1E52F0-8522-44D5-8603-21FB4EC9EAF9.jpg', type: 'image/jpeg', data: RNFetchBlob.wrap(this.state.profilePicURL) }
]).then((resp) => {
const response = JSON.parse(resp.data);
if(response.statusCode == 200){
this.setState({
profilePicURL: response.data.profileUrl
})
this.EditProfile(this.state.profilePicURL)
}
}).catch((err) => {
this.setState({error: err})
})

this.state.profilePicURL ==> file:///storage/ext_sd/DCIM/100MEDIA/IMAG0495.jpg
Also some time i am gettting this issue RNFetchBlob error when sending request : failed to connect to /localhost (port 8004) after 60000ms: isConnected failed: ETIMEDOUT (Connection timed out)
And also this one read failed: EBADF (Bad file descriptor) YellowBox.js:78

>All comments

Any help on this ? or the react native fetch blob is unstable and unable to perform. I testing my app on latest android version 6,7 NOw problem i am facing is sometime it's throw error that

  1. Read failed: EBADF (Bad file descriptor) YellowPage.js 78
  2. RNFetchBlob error when sending request : failed to connect to /localhost (port 8004) after 60000ms: isConnected failed: ETIMEDOUT (Connection timed out).

Plz take a look in this issue.

Was this page helpful?
0 / 5 - 0 ratings