-
Notifications
You must be signed in to change notification settings - Fork 26.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[image_picker: ^1.1.0] Android 12+ image viewer crashes when no images are passed to selected images #147280
Comments
Hi @Biowulf21, is this the only device you're seeing it on or are other devices affected? I tested this on my pixel 7 running android 14 and it doesn't allow me to submit 0 items. Can you also try uprading to the latest version of Thank you |
hi @danagbemava-nc , I tested this on my Samsung S21+ and it crashes the app as well. Huawei P30 Pro also crashes per our QA team. I'll look into the latest version next week. Thank you! EDIT: Corrected the device models |
@Biowulf21, just to confirm, are you calling |
Hi @danagbemava-nc I'm using pickMultiImage. So sorry for the delay, I'm out of the house right now, but I'll be sure to update this thread later tonight. Thank you! Edit: I tested the same flow using the latest image_pickers version (1.1.0) and the issue is still there. |
Thanks for the update. Just to confirm, were the samsung s21+ and the huawei p40 both running android 13? Have you tested this on any other OS version? |
Hello, my team and I tested this on three devices: Huawei P30 Pro (Android 12), Infinix SMART 8 (Android 13), and Samsung 21+ (Android 14). I also updated the title of the issue for your reference @danagbemava-nc. Sorry for the confusion. |
Thanks for the update. While I cannot reproduce this on my device (the picker won't allow sending back 0 items), it seems like we are passing a null URI to https://github.com/flutter/packages/blob/6e6082660b73144e5fedf28545602c1ef6588f8e/packages/image_picker/image_picker_android/android/src/main/java/io/flutter/plugins/imagepicker/FileUtils.java#L55 I think it would be best to catch the null_pointer exception or check if the uri is null before processing. Labeling for further insight. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This looks like the same issue that flutter/packages#4836 fixed for single-item selection, where some pickers are, instead of returning no clip data, returning clip data with a null URI. It's not fixed for the multi-item codepath yet (see flutter/packages#4836 (comment) for a suggestion on this). |
Re-opening since the PR didn't fix all codepaths. And in particular, the original report's stack is in |
@stuartmorgan @gmackall I created a new PR complementing the one I had previously sent. |
i don't remember closing this? |
I think its just a Github bug, I believe updating the main branch on a fork (maybe only with the github ui?) will sometimes re-close an issue when that update pulls in a commit that contains the description "fixes #issue number". So if a commit gets merged to main saying "fixed..." but then the issue gets re-opened, and then you update your main branch (and pull in the commit) it will sometimes re-close. |
This should be fixed by flutter/packages#5009 |
Steps to reproduce
EDIT: I am using the
pickMultiImage
functionView Selected
on lower left side of screenSelected
button to unselect the single image (add
button will reflect 0 images selected)Expected results
Image picker should close when this flow is done, as tested on native android applications.
Actual results
The app crashes.
Code sample
Screenshots or Video
Logs
Logs
Flutter Doctor output
Doctor output
The text was updated successfully, but these errors were encountered: