Repository navigation
[image_picker] NPE On Permission error. #108334
Description
Activity
- changed the title
[-]NPE On Permission error.[/-][+][image_picker] NPE On Permission error.[/+]on Jul 26, 2022 - addedin triagePresently being triaged by the triage teamPresently being triaged by the triage team
on Jul 26, 2022 Hi @ajzome, what devices experience the NPE?
Please also share the complete stacktrace, the version of image_picker that is used as well as the version of flutter used to deploy the app.
Thank you
- addedwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds
on Jul 26, 2022 The devices we have hits so far are:
Motorola Lenovo K11
Samsung Galaxy J5 Pro
Lenovo Tab M10 (FHD)
Redmi 8AStacktrace: Caused by: java.lang.NullPointerException: at java.util.AbstractCollection.addAll (AbstractCollection.java:343) at io.flutter.plugins.imagepicker.ImagePickerCache.saveResult (ImagePickerCache.java:5) at io.flutter.plugins.imagepicker.ImagePickerDelegate.finishWithError (ImagePickerDelegate.java:7) at io.flutter.plugins.imagepicker.ImagePickerDelegate.onRequestPermissionsResult (ImagePickerDelegate.java:43) at io.flutter.embedding.engine.FlutterEngineConnectionRegistry$FlutterEngineActivityPluginBinding.onRequestPermissionsResult (FlutterEngineConnectionRegistry.java:20) at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.onRequestPermissionsResult (FlutterEngineConnectionRegistry.java:20) at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onRequestPermissionsResult (FlutterActivityAndFragmentDelegate.java:59) at io.flutter.embedding.android.FlutterActivity.onRequestPermissionsResult (FlutterActivity.java:10) at com.zomecorp.zome.MainActivity.onRequestPermissionsResult (MainActivity.java:17) at android.app.Activity.dispatchRequestPermissionsResult (Activity.java:7991) at android.app.Activity.dispatchActivityResult (Activity.java:7813) at android.app.ActivityThread.deliverResults (ActivityThread.java:4703) at android.app.ActivityThread.handleSendResult (ActivityThread.java:4752) at android.app.servertransaction.ActivityResultItem.execute (ActivityResultItem.java:49) at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:108) at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:68) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1993) at android.os.Handler.dispatchMessage (Handler.java:106) at android.os.Looper.loop (Looper.java:216) at android.app.ActivityThread.main (ActivityThread.java:7266) at java.lang.reflect.Method.invoke (Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:494) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:975)- removedwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds
on Jul 28, 2022 Hi @ajzome, what versions of android are the devices running on?
Please also provide the output of
flutter doctor -vas well as the version ofimage_pickerused.Thank you
- addedwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds
on Jul 28, 2022 I do not understand why you need all this information. There is an obvious issue in the java code that I have pointed out.
- removedwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds
on Jul 28, 2022 Hi @ajzome, it is part of our triage process to collect that information. It makes it easier for us to see where to start investigating. Since you cannot reproduce the issue locally, this is more relevant.
Thank you
- addedwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds
on Jul 29, 2022 Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now.
If you find this problem please file a new issue with the same description, what happens, logs and the output of 'flutter doctor -v'. All system setups can be slightly different so it's always better to open new issues and reference the related ones.
Thanks for your contribution.- addedr: timeoutIssue is closed due to author not providing the requested details in timeIssue is closed due to author not providing the requested details in time
on Aug 19, 2022 8 remaining items
- addedp: image_pickerThe Image Picker plugin.The Image Picker plugin.a: productionIssues experienced in live production appsIssues experienced in live production appsand removedin triagePresently being triaged by the triage teamPresently being triaged by the triage team
on Aug 23, 2022 - addedP2Important issues not at the top of the work listImportant issues not at the top of the work list
on Aug 25, 2022 - addedP1High-priority issues at the top of the work listHigh-priority issues at the top of the work listand removedP2Important issues not at the top of the work listImportant issues not at the top of the work list
on Nov 3, 2022 In my case the crash happens when the other plugin requests the permissions (bluetooth) with the same REQUEST_CODE (2345).
This was fixed just now by @JeroenWeener in flutter/packages#3448 .
- addedr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
on Mar 17, 2023 This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.- locked as resolved and limited conversation to collaborators
on Mar 31, 2023 - addedpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.
on Jul 5, 2023
Steps to Reproduce
I have thus far been unable to reproduce the error locally, however I do occasionally see reports from users. The problem seems to come from an error during the permissions check. Based on the stack trace I have located the bug in ImagePickerCache::saveResult (ImagePickerCache.java). After creating the set it does an addAll of paths. However paths is nullable but addAll does not handle null parameters. Null is passed in via ImagePickerDelegate::finishWithError which happens in a few spots
Expected results:
No NPE
Actual results:
An NPE during various errors in the ImagePickerDelegate.