RedApparat / Fotoapparat

Making Camera for Android more friendly. 📸
Apache License 2.0
3.81k stars 405 forks source link

`takePicture()` freezes on API 33. #424

Open RobinFarmer opened 1 year ago

RobinFarmer commented 1 year ago

Please check if your issue exists.

Issues should only be posted after you have been able to reproduce them and confirm that they are either a missing functionality or a bug.

What are you trying to achieve or the steps to reproduce?

When trying to run the sample app on a Google Pixel running on API 33 (Android 13, TIRAMISU) taking a photo just freezes the preview and it never actually completes.

In the Log I can see the following being logged:

E/Camera: Error 2
E/Camera: Error 1

How did you initialize FA?

Just using the sample app, the only I changed was the sdk version inside of the top level build.gradle to support api 33.

sdk    : [
    minimum: 30,
    target : 33
],

What was the result you received?

Preview freezes and no picture is taken successfully.

What did you expect?

Normal camera behavior where the picture is taken and the preview just stays active.

Context:

noxo commented 1 year ago

good to know something like this is expected, does it work if target sdk is lowered to 31 or 32? is it real device or emulator? i think i've seen that error on emulator.

RobinFarmer commented 1 year ago

@noxo Thanks for your message, what do you mean that this is expected?

I tried the following (All on emulators):

Left SDK target on 33 top level build.gradle.

Run on Emulator that has API 28 -> works fine. Run on Emulator that has API 30 -> works fine. Run on Emulator that has API 31 -> Stopped working with E/Camera: Error 2 Run on Emulator that has API 32 -> Does not work with error: E/Camera: Error 2 Run on Emulator that has API 33 -> Does not work with error: E/Camera: Error 2

noxo commented 1 year ago

Thanks for info. I've been observing same behaviour on emulator, but then it works on real device (tested on Fold3 & API 32)

It's expected, because nobody seems to maintain the project anymore, so I would look for something else if you are looking for camera lib.

RobinFarmer commented 1 year ago

Thanks, I was just able to test on a real device on API 33 and can confirm it does not happen. So it seems to be a problem with emulators...

guyca commented 1 year ago

I can confirm that taking pictures seems to work on a real device. I guess it's time to migrate away from this library. What are y'all migrating to?

RobinFarmer commented 1 year ago

We switched to CameraX which has been a great experience!