App crashing on using camera - Capacitor on Android 12 / 13

Explanation of Problem:

App crashes and restarts when taking and confirming a picture on Android 12 and 13.
App crashes on clicking this button after taking picture

We are using Capacitor camera plugin. When capturing an image with the Camera plugin it crashes everytime I take a picture and the app restarts.

This only happens on Android 12 and 13. It works perfectly fine on Android less than 12. I can’t find any exceptions when debugging on a mobile device because debugging is killed as soon as an image is captured and then once the image captured is confirmed it restarts the application.

Capacitor ver: 4.2.0
minsdkversion: 22
compilesdkversion: 33
targetsdkversion: 33

Tried Solutions
We tried different open source cordova plugins but nothing worked as all of them have not been updated since 2021. Please help us resolve this issue or should we consider changing our dev platform ?

Its 3rd day of this problem. We are spending man hours like anything on this bug.

Thank you for your time in advance.

Is capacitor community this dead ??? no reply since 5 days

1 Like

Hi @ersaurabh101, I think the main issue is that Capacitor 4.x does not work nicely when we set compileSdkVersion and targetSdkVersion from 32 to 33.

You can check out this for more details:

1 Like