Replies: 10 comments 18 replies
-
|
Thanks for the report . Could you please share: The device model and OS version where this happens The library version you are using A minimal code snippet showing how you are launching ImagePickerLauncher I tested on both Android and iOS and the Camera UI works fine, so this will help narrow down if it’s device-specific or an integration issue. Find info.plist file to add the request permission on IOS . Android is not necessary request the permission @rnstewart |
Beta Was this translation helpful? Give feedback.
-
|
The other thing is you can just use ImagePicker Launch because it has the option to select from the gallery and capture photos, but I would like to know the model of the cell phone you are using to do some research. |
Beta Was this translation helpful? Give feedback.
-
|
Oh yeah, of course. Sorry, I should have included this information. I'm testing it on Android 16 and iOS 18.5. The Compose code looks like this:
So when I want to bring up the camera , I just set I have verified that Camera permissions are set in |
Beta Was this translation helpful? Give feedback.
-
|
OK, I'm sorry, I made a mistake. It looks like it is working on iOS after all. Sorry about that. So the problem is just getting the camera to show on Android. Although I do have another question: when I trigger |
Beta Was this translation helpful? Give feedback.
-
|
@rnstewart Thanks for sharing the details That code snippet helps a lot. The issue is that ImagePickerLauncher and GalleryPickerLauncher should not be placed directly inside the when block. They are side-effect launchers and need to be controlled by state (similar to how rememberLauncherForActivityResult works in Jetpack Compose). In your code, the camera session is being created (that’s why you see the camera icon in Android), but the UI never shows because the launcher isn’t properly tied to the composition lifecycle. Here’s a working example adapted to your PhotoParams setup: With this approach, the pickers are only added to the composition when needed, and dismissed properly after capturing or selecting a photo. This ensures the Camera UI (or Gallery UI) is shown correctly on both Android and iOS. |
Beta Was this translation helpful? Give feedback.
-
|
Try the proposal I gave you adapted to your code. If it worked for you, let me know so I can move the issue to discussion because it is not an issue. |
Beta Was this translation helpful? Give feedback.
-
|
ImagePickerLauncher has the 2 functionalities of taking photos and selecting from the gallery. When using ImagePickerLauncher you will have the 2 options: taking photos and choosing. These are not unnecessary options. In iOS it is handled differently, but you can customize that dialog to your liking. But for now, in the library, when calling ImagePickerLauncher in iOS, the dialog will always appear. In the next version, we can remove that option and have it go directly to the camera with a flag. |
Beta Was this translation helpful? Give feedback.
-
|
I'm sorry it took me so long to get back, but I still can't get the camera to open in Compose on Android. As far as I can tell, my code is basically the same as yours. I have a Don't worry about the The Gallery works fine, but when I tell it to open the camera, it doesn't show. It does show the little green icon in the upper right corner of the screen, indicating that Android thinks the camera is open. It requests permission the first time, and I grant it. I've also added I'm not sure what else I could be missing here. |
Beta Was this translation helpful? Give feedback.
-
|
Aha! Got it. This was just a layout issue. I was expecting the camera picker to pop up as a bottom sheet like the gallery picker. I didn't realize it was an embedded view. I just changed my Compose layout to a Thank you very much! |
Beta Was this translation helpful? Give feedback.
-
|
Hi guys, I also ran into the same issue. Thanks @rnstewart for the clarification! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have been using
GalleryPickerLauncherto select pictures from my Gallery, and it's working great. I am now working on adding Camera capability to my app. So I have added code to callImagePickerLauncheras described in the documentation, but when I do that, nothing comes up.It doesn't work on Android or iOS. On Android, it shows the camera icon on the right side of the status bar, indicating that the camera is in use, but no Camera UI appears in the app.
I've verified that I do have Camera permissions allowed for my app.
Beta Was this translation helpful? Give feedback.
All reactions