You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The devices we have hits so far are:
Motorola Lenovo K11
Samsung Galaxy J5 Pro
Lenovo Tab M10 (FHD)
Redmi 8A
Stacktrace:
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)
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.
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.
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 -v and a minimal reproduction of the issue.
Activity
[-]NPE On Permission error.[/-][+][image_picker] NPE On Permission error.[/+]danagbemava-nc commentedon 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
ajzome commentedon Jul 28, 2022
The devices we have hits so far are:
Motorola Lenovo K11
Samsung Galaxy J5 Pro
Lenovo Tab M10 (FHD)
Redmi 8A
danagbemava-nc commentedon 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
ajzome commentedon 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.
danagbemava-nc commentedon Jul 29, 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
github-actions commentedon Aug 19, 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.
8 remaining items
RustamG commentedon Dec 27, 2022
In my case the crash happens when the other plugin requests the permissions (bluetooth) with the same REQUEST_CODE (2345).
gnprice commentedon Mar 16, 2023
This was fixed just now by @JeroenWeener in flutter/packages#3448 .
github-actions commentedon Mar 31, 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.