WebsiteBeaver / android-document-scanner

65 stars 48 forks source link

File not Found Exception #42

Closed shaifu closed 12 months ago

shaifu commented 12 months ago

I was using older version of this library. It was working fine but crashed on camera orientation. Now i am using latest version but I am facing this issue.

java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=0, result=-1, data=Intent { (has extras) }} to activity {com.mgc.e_realtors/com.mgc.e_realtors.Realtor.Signup.Cnic.CnicActivity}: java.lang.RuntimeException: java.io.FileNotFoundException: /file:/storage/emulated/0/Android/data/com.mgc.e_realtors/files/Pictures/DOCUMENT_SCAN_0_20231202_1253008845266341652995473.jpg: open failed: ENOENT (No such file or directory)

I am setting the image using Picasso library. It was working fine in older version of the library.

Picasso.get().load(new File(result)).placeholder(R.color.light_gray).into(iv_cnicFront);

shaifu commented 12 months ago

I have resolved the issue by result.replace("file://","") Its working fine now