react-native-file-picker icon indicating copy to clipboard operation
react-native-file-picker copied to clipboard

com.filepicker.FilePickerModule.getPath FilePickerModule.java, line 223 java.lang.NumberFormatException: For input string: "msf:124969"

Open carlmagumpara opened this issue 4 years ago • 12 comments

carlmagumpara avatar May 08 '20 12:05 carlmagumpara

I am gettting this error when the filename is long. For example national-cancer-institute-dMZC6hdobnk-unsplash.jpg but if I change the name to img1.jpg, then it is not happening.

omarinho avatar Jun 19 '20 13:06 omarinho

Getting the same error on all files. File name length doesn't matter.

farshed avatar Jul 07 '20 06:07 farshed

any updates

carlmagumpara avatar Jul 21 '20 02:07 carlmagumpara

Will it ever be fixed? The only files that work for me are pdf files. Images, videos, all fail with java.lang.NumberFormatException: For input string: "msf:X"

DnEgorWeb avatar Sep 11 '20 12:09 DnEgorWeb

Hi,is there anyone know how to fix this java.lang.NumberFormatException: For input string: "msf:X" issue.

official-bharat avatar Dec 15 '20 12:12 official-bharat

Hey, I am stuck at this issue, can anyone help, getting error {"error": "java.lang.NumberFormatException: For input string: "msf:6655""}

devarora07 avatar Dec 17 '20 15:12 devarora07

The problem is on choose a file from "Recent Files". Check replace this on FilePickerModule.java

final Uri contentUri = ContentUris.withAppendedId( Uri.parse(prefix + "downloads/public_downloads"), Long.valueOf(id));

for this

final Uri contentUri = ContentUris.withAppendedId( Uri.parse(prefix + "downloads/public_downloads"), Long.valueOf(split[1]));

dominguezcm avatar Jan 05 '21 13:01 dominguezcm

The problem is on choose a file from "Recent Files". Check replace this on FilePickerModule.java

final Uri contentUri = ContentUris.withAppendedId( Uri.parse(prefix + "downloads/public_downloads"), Long.valueOf(id));

for this

final Uri contentUri = ContentUris.withAppendedId( Uri.parse(prefix + "downloads/public_downloads"), Long.valueOf(split[1]));

thanks @dominguezcm I have the same error and this fixed the error. but have I change the library code manually after each yarn? or there is some other solution?

bodaghialib4 avatar Aug 14 '21 13:08 bodaghialib4

You can use patch-package.

This week i will try to upload this fix on new version. (PRs are welcome)

luisfuertes avatar Aug 16 '21 08:08 luisfuertes

After updating to latest version of 0.0.21, the issues with " java.lang.NumberFormatException:...." is fixed but it seems to throw new error for images and pdf files which were working before

{"error": "java.lang.ArrayIndexOutOfBoundsException: length=1; index=1"}

sasilta avatar Sep 14 '21 09:09 sasilta

@sasilta did you find a solution to it?

ZComwiz avatar Dec 05 '21 19:12 ZComwiz

@ZComwiz not yet.

sasilta avatar Mar 07 '22 12:03 sasilta