Skip to content

Android error: Error while casting ReactNativeBlobUtilFileResp #88

@ricbermo

Description

@ricbermo

Hello, thanks for taking your time to maintain this library.
Somedays, ago, the "download" stopped working. I was able to track down and fix the issue (credits to @srbulovicdusan).

So, here's an image of the error
image

The fix is,

  1. go to ReactNativeBlobUtilFileResp.java and add a new constructor like this:
public ReactNativeBlobUtilFileResp(ResponseBody body) {
  super();
  this.originalBody = body;
}

then, in ReactNativeBlobUtilReq.java around line 607 replace how ReactNativeBlobUtilFileResp is instanciated.

// remove or comment
ReactNativeBlobUtilFileResp = (ReactNativeBlobUtilFileResp) responseBody;
// use this
ReactNativeBlobUtilFileResp = new ReactNativeBlobUtilFileResp(responseBody);

Important information:

  1. RN version: 0.64.2
  2. lib. version: 0.13.18

Note: I was not able to reproduce this issue on a "clean" RN project.

Fix found here

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions