Skip to content

Capacitor Camera restarts apps on certain Android 13 devices #1736

@klaurtar

Description

@klaurtar

Bug Report

Plugin(s)

@capacitor/camera v5.X.X

Capacitor Version

💊   Capacitor Doctor  💊 

Latest Dependencies:

  @capacitor/cli: 5.2.3
  @capacitor/core: 5.2.3
  @capacitor/android: 5.2.3
  @capacitor/ios: 5.2.3

Installed Dependencies:

  @capacitor/cli: 5.0.3
  @capacitor/core: 5.2.2
  @capacitor/android: 5.0.3
  @capacitor/ios: 5.0.3

[success] iOS looking great! 👌
[error] Missing <manifest package=""> attribute in app/src/main

Platform(s)

Certain Android devices running Android 13 with SDK version 33
Reports of this happening have come from:

  • Samsung SM-A426U
  • Samsung Galaxy S21FE
  • Samsung Galaxy S21 5G

Current Behavior

When Camera.getPhoto() is called the system allows the user to choose a photo or take a photo. When take a photo is clicked, the system's camera UI is displayed. A user is then allowed to take a photo. When the photo is taken, it will then ask the user if they would like to retry the photo or if it is ok. When the ok option is selected, the app restarts as if the user had just opened the app. No debugging occurs as the console is wiped everytime this happens.

Screen_Recording_20230814_223820_bad_camera_android.mp4

app crashes

Expected Behavior

Camera.getPhoto() should allow Android 13 users to take a photo, and then approve the photo. This should not restart the app.

Record_2023-08-14-22-40-15.mp4

Code Reproduction

Here is a working recreation of the bug

Run the Android app on a physical Samsung Android 13 device like I listed above. Click the + icon on the placeholder image to take a photo. Then quickly click the ok or checkmark button. This should cause the app to restart. I had to take a photo 3 times before the bug started occurring. If it is not occuring, kill the app and restart it and repeat the process.

Other Technical Details

Additional Context

I found this related Ionic forum post about this issue

I also noticed from testing that if a user with an effected device takes a photo, then waits for about 10 seconds before pressing ok or the checkmark on the system UI, it will work as it should. However, if a user quickly takes a photo and accepts it, the app restarts.

I unfortunately need a fix for this asap. My business relies on this feature. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions