[🐛] When select any image crash app
See original GitHub issueHow to repeat issue and example
1.- Lauch method launchImageLibrary 2.- Select any image 3.- Confirm & crash
Solution
What needs to be done to address this issue? No crash app when select any image.
Additional Information
FATAL EXCEPTION: main
Process: com.copymaster, PID: 7518
java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=13002, result=-1, data=Intent { flg=0x1 hwFlg=0x10 (has extras) }} to activity {com.copymaster/com.copymaster.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.net.Uri.getLastPathSegment()' on a null object reference
at android.app.ActivityThread.deliverResults(ActivityThread.java:5471)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:5512)
at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:149)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:103)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2386)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:213)
at android.app.ActivityThread.main(ActivityThread.java:8178)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.net.Uri.getLastPathSegment()' on a null object reference
at com.imagepicker.Utils.getResponseMap(Utils.java:330)
at com.imagepicker.ImagePickerModule.onImageObtained(ImagePickerModule.java:145)
at com.imagepicker.ImagePickerModule.onActivityResult(ImagePickerModule.java:176)
at com.facebook.react.bridge.ReactContext.onActivityResult(ReactContext.java:308)
at com.facebook.react.ReactInstanceManager.onActivityResult(ReactInstanceManager.java:758)
at com.facebook.react.ReactDelegate.onActivityResult(ReactDelegate.java:90)
at com.facebook.react.ReactActivityDelegate.onActivityResult(ReactActivityDelegate.java:112)
at com.facebook.react.ReactActivity.onActivityResult(ReactActivity.java:68)
at android.app.Activity.dispatchActivityResult(Activity.java:8413)
at android.app.ActivityThread.deliverResults(ActivityThread.java:5464)
... 11 more
Environment: “react”: “16.13.1”, “react-native”: “0.63.3”, “react-native-image-picker”: “^3.3.2”,
Phone Test:
- Huawei
Issue Analytics
- State:
- Created 3 years ago
- Reactions:10
- Comments:27 (1 by maintainers)
Top Results From Across the Web
My app crash as soon as I select a image? - Stack Overflow
But still the app keeps getting closed as soon as I click on the gallery button and select an image. I tried running...
Read more >[Image Picker plugin] [Image Picker plugin] its crashing on ios ...
As soon as I get the alert for the permission to access the photo the app crashes.The app crashes if I select selected...
Read more >[Solved] App crashes when using Image Picker in iOS 12 [Aug ...
When using the Image Picker / Photo Library component, it gives me an error and the companion crashes. Edit: Tried on a test...
Read more >[Facebook] App crash once you click a picture or Post ...
Same here, always happen when click on post with multiple images, the post disappear then the next click, any action will crash the...
Read more >Crashes | Android Developers
On this page · Detect the problem. Android vitals · Diagnose the crashes. How to read a stack trace; Tips for reproducing a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It may be obvious but be sure your button handle double taps. It’s ease to reproduce this issue double tapping the button. With android, native modules can be mounted many times, it’s not the case with iOS. Maybe your customers tap the button, the native modal take to many time to show and clicked again. Or maybe your UI is not good enough and the “is tapping” state is not very clear for the user.
Issue still unresolved.