ivpusic / react-native-image-crop-picker

iOS/Android image picker with support for camera, video, configurable compression, multiple images and cropping
MIT License
6.16k stars 1.56k forks source link

In Android 10 some user has this error java.lang.NullPointerException: uriString #1728

Open tastafur opened 2 years ago

tastafur commented 2 years ago

Version

Tell us which versions you are using:

Platform

Tell us to which platform this issue is related

Devices users

Samsung Galaxy Note9 (SM-N960F)

Expected behaviour

Open crop picker tool

Actual behaviour

java.lang.NullPointerException: uriString
        at android.net.Uri$StringUri.<init>(Uri.java:496)
        at android.net.Uri$StringUri.<init>(Uri.java:486)
        at android.net.Uri.parse(Uri.java:458)
        at com.reactnative.ivpusic.imagepicker.PickerModule.openCropper(PickerModule.java:421)
        at java.lang.reflect.Method.invoke(Method.java:-2)
        at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
        at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:188)
        at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java:-2)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
        at android.os.Looper.loop(Looper.java:237)
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
        at java.lang.Thread.run(Thread.java:919)

Steps to reproduce

Sometimes some users the crop picker tool does not open in android 10 due to this error

mojtabaasadi commented 2 years ago

I am facing same problem on android 10 and 11

sspeng123 commented 2 years ago

same .. FATAL EXCEPTION: mqt_native_modules Process: , PID: 8910 java.lang.NullPointerException: uriString at android.net.Uri$StringUri.(Uri.java:496) at android.net.Uri$StringUri.(Uri.java:486) at android.net.Uri.parse(Uri.java:458) at com.reactnative.ivpusic.imagepicker.PickerModule.openCropper

mojtabaasadi commented 2 years ago

I found out that problem is in my code when calling open cropper, it was getting called with empty path

On Mon, Mar 14, 2022, 10:51 PM sspeng123 @.***> wrote:

same .. FATAL EXCEPTION: mqt_native_modules Process: , PID: 8910 java.lang.NullPointerException: uriString at android.net.Uri$StringUri.(Uri.java:496) at android.net.Uri$StringUri.(Uri.java:486) at android.net.Uri.parse(Uri.java:458) at com.reactnative.ivpusic.imagepicker.PickerModule.openCropper

— Reply to this email directly, view it on GitHub https://github.com/ivpusic/react-native-image-crop-picker/issues/1728#issuecomment-1067198370, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFOGYONY3GTRZSVA7SFWSJDU76GUPANCNFSM5NGDRG5Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>

sspeng123 commented 2 years ago

thanks, I ready fixed ImagePicker.openCropper({ path: resp.sourceURL || resp.path, includeBase64: true, })

I found out that problem is in my code when calling open cropper, it was getting called with empty path On Mon, Mar 14, 2022, 10:51 PM sspeng123 @.> wrote: same .. FATAL EXCEPTION: mqt_native_modules Process: , PID: 8910 java.lang.NullPointerException: uriString at android.net.Uri$StringUri.(Uri.java:496) at android.net.Uri$StringUri.(Uri.java:486) at android.net.Uri.parse(Uri.java:458) at com.reactnative.ivpusic.imagepicker.PickerModule.openCropper — Reply to this email directly, view it on GitHub <#1728 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFOGYONY3GTRZSVA7SFWSJDU76GUPANCNFSM5NGDRG5Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you commented.Message ID: @.>

mojtabaasadi commented 2 years ago

@sspeng123 great, you can close this issue now, I think.