rn-fetch-blob: unexpected end of stream

here my info

info

React Native Environment Info:
  System:
    OS: Windows 10
    CPU: (4) x64 Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz
    Memory: 3.32 GB / 11.89 GB
  Binaries:
    Yarn: 1.12.3 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.9.0 - ~\AppData\Roaming\npm\npm.CMD
  IDEs:
    Android Studio: Version  3.2.0.0 AI-181.5540.7.32.5056338
"react": "16.8.3",
"react-native": "0.59.9",
"rn-fetch-blob": "^0.10.13", && "rn-fetch-blob": "^0.10.15",

I using fetch Post method . and I checked with CURL and received result and it worked. before upgrading everythings work well

This has only starting happening after upgrading RN.(54 to 59)

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 2
  • Comments: 16

Most upvoted comments

Add android permission at run time WRITE_EXTERNAL_STORAGE

@luco I checked my code, and added write and read storage permission and the problem is gone.

Add line below in AndroidManifest.xml <uses-permission android:name="android.permission.CAMERA" /> Refer PermissionsAndroid in react native docs

  RNFetchBlob.config({
    trusty : true,
    timeout: 1000

  })
  .fetch(config.method,strings.API.BASE_URL+config.url,headers,JSON.stringify(config.data))
  .then((res) => {
          console.log(`We got your Response string- ${res.text()}`);
          let data = {data:res.json()}
          success(data);
  })
  .catch((err) => {
    console.log(`Whoopsy doodle! Error - ${err}`)
    failure(err);
  });

this is my code … i am getting error

" sl=0x9eaa0e80 info_callback ignored 02-05 14:43:59.249 8855-11266/com.consumerconnect D/NativeCrypto: doing handshake – ret=1 02-05 14:43:59.249 8855-11266/com.consumerconnect I/System.out: gba_cipher_suite:TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 02-05 14:43:59.250 8855-11266/com.consumerconnect I/System.out: [CDS]rx timeout:1000 02-05 14:43:59.250 8855-11266/com.consumerconnect I/System.out: [CDS]rx timeout:1000 02-05 14:43:59.254 8855-11266/com.consumerconnect D/NativeCrypto: ssl=0x9eaa0e80 NativeCrypto_SSL_interrupt 02-05 14:43:59.254 8855-11266/com.consumerconnect D/NativeCrypto: sslNotify, appData=0x9dc9db40 ret=1 02-05 14:43:59.254 8855-11266/com.consumerconnect D/NativeCrypto: sslNotify, appData=0x9dc9db40 ret=1 02-05 14:43:59.254 8855-11266/com.consumerconnect D/NativeCrypto: ssl=0x9eaa0e80 info_callback where=0x4008 ret=256 02-05 14:43:59.254 8855-11266/com.consumerconnect D/NativeCrypto: ssl=0x9eaa0e80 SSL3 alert write:W:CN warning close notify 02-05 14:43:59.254 8855-11266/com.consumerconnect D/NativeCrypto: ssl=0x9eaa0e80 info_callback ignored 02-05 14:43:59.255 8855-11266/com.consumerconnect I/System.out: close [socket][/192.168.43.243:35867] ReactNativeJS: Whoopsy doodle! Error - Error: unexpected end of stream "

Thanks Man!, @AminTaghikhani I searched here and there and finally this answer saved my day. Thanks

This happens only on Android for me.