[Camera Plugin] App crashes after selecting image

Forge Component
(24)
Published on 25 Oct by OutSystems R&D
24 votes
Published on 25 Oct by OutSystems R&D

Hi,


We're experiencing an app crash when selecting an image, more specifically from the download folder, in some Android phones.

The problem resides in the function getRealPathFromURI_API11_And_Above in the FileHelper file as can be seen below:

11-22 14:58:45.619 14732 14892 E AndroidRuntime: java.lang.NumberFormatException: For input string: "raw:/storage/emulated/0/Download/filename.jpg"11-22 14:58:45.619 14732 14892 E AndroidRuntime: at java.lang.Long.parseLong(Long.java:594)11-22 14:58:45.619 14732 14892 E AndroidRuntime: at java.lang.Long.valueOf(Long.java:808)11-22 14:58:45.619 14732 14892 E AndroidRuntime: at org.apache.cordova.camera.FileHelper.getRealPathFromURI_API11_And_Above(FileHelper.java:101)11-22 14:58:45.619 14732 14892 E AndroidRuntime: at org.apache.cordova.camera.FileHelper.getRealPath(FileHelper.java:60)11-22 14:58:45.619 14732 14892 E AndroidRuntime: at org.apache.cordova.camera.CameraLauncher.processResultFromGallery(CameraLauncher.java:703)11-22 14:58:45.619 14732 14892 E AndroidRuntime: at org.apache.cordova.camera.CameraLauncher.access$000(CameraLauncher.java:74)11-22 14:58:45.619 14732 14892 E AndroidRuntime: at org.apache.cordova.camera.CameraLauncher$1.run(CameraLauncher.java:851)11-22 14:58:45.619 14732 14892 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)11-22 14:58:45.619 14732 14892 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)11-22 14:58:45.619 14732 14892 E AndroidRuntime: at java.lang.Thread.run(Thread.java:764)


I also noticed that the original repository of the "cordova-plugin-camera" on github already has this fix on their latest release, but the fix isn't present in the OutSystems repository's latest release.

Can you please update the plugin so that it includes this fix?


Thanks

David