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]ImageSource.camera doesn't ask camera permission #13921
Comments
Workaround
|
Run into this after https://github.com/flutter/flutter/wiki/Updating-Flutter-projects-to-Gradle-4.1-and-Android-Studio-Gradle-plugin-3.0.1 and updating all plugins to the latest version. Manually enabling the camera in Android made it work (Setttings > Apps > Your App > Permissions and enable Camera) |
Pretty critical defect for us to get a release out. |
I've been chatting with @zoechi on Gitter and at the bottom of this reply is his caught exception. It looks like the I found that the android.media.action.IMAGE_CAPTURE Intent which the library uses now requires the Runtime Permission for the Camera after M as noted by the docs.
So either the patching the external library or using an internal patch like @jimmyshiau above should resolve the issue.
|
Tagging milestone 3; this is a core plugin, and permissions are important to get right. @collinjackson are you able to look into this? |
The android.media.action.IMAGE_CAPTURE intent, doesn't need the The documentation of the But besides all that: Is there a specific reason for using a library that comes with it's own custom image picker ui, whcih creates a dependency to another library and with that several dependencies to other libraries as well? |
@mtthsfrdrch yea, that was my thoughts' as well. I've already started a But one point I would mention is that if the CAMERA permission is declared by other plugin's the app uses the |
maybe the intent was to have the same component for IOS and Android? |
@slightfoot fair enough, but i think in case both (starting other camera apps and approaching the camera api directly) get used, i'd rather prefer it crashing and with that being reported in crashlogs over silently failing ... or even worse: forcing the CAMERA permission on all the apps (and their users) that just want to pick an image (that would be an even bigger issue and for me personally a NO GO to use this plugin) i'd Assume apps doing both are edge cases anyway and people messing with the camera api + its compatibility surely have time to build their own image_picker plugin as well 😉 the |
@collinjackson assigning to you based on discussion |
This fork https://github.com/arok/plugins/tree/master/packages/image_picker should work as temporary workaround |
@collinjackson Are you currently working on this? I can push a short term fix to request the correct runtime permissions to get this working. |
@jonahwilliams thanks for #424, I can land that as soon as the tests pass. |
I've just pushed a new version (0.3.1) to pub which has the fixes implemented. |
Installed version 0.4.0. It's giving me the same issue after I get past the permission dialogs. |
same for me on 0.4.1 |
@BarbaricGamester @wrumble if you are still having issues, can you file a new bug with repro steps, etc.? |
It would also be useful to know if this plugin works at 0.3.1 still or if this was a regression introduced after 0.4.0 |
Updated yesterday to Getting a crashing app when trying to pick a file from the camera with
|
@lifenautjoe pls see #29422 |
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 |
Steps to Reproduce
There are 2 buttons to pick image
Case 1: Tap gallery button then tap camera button
It will ask gallery permission when tap gallery button,
then tap camera button, it will show the following error
Case 2: Tap camera button then tap gallery button (before allow gallery permission)
It will show the following error
then tap tap gallery button, it will show the following error
Flutter Doctor
The text was updated successfully, but these errors were encountered: