Skip to content
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

[Bug]: Camera opens after second attempt on Android #7721

Closed
1 of 3 tasks
daniil777555 opened this issue Oct 15, 2024 · 2 comments
Closed
1 of 3 tasks

[Bug]: Camera opens after second attempt on Android #7721

daniil777555 opened this issue Oct 15, 2024 · 2 comments
Labels

Comments

@daniil777555
Copy link

Capacitor Version

classpath 'com.google.gms:google-services:4.4.0'
classpath 'com.android.tools.build:gradle:8.2.1'
distributionUrl=https://services.gradle.org/distributions/gradle-8.2.1-all.zip

Capacitor dependencies
"@capacitor/android": "^6.1.2",
"@capacitor/app": "^6.0.1",
"@capacitor/camera": "^6.0.2",

Other API Details

No response

Platforms Affected

  • iOS
  • Android
  • Web

Current Behavior

On newer versions of android camera opens after 2 attempts. I call Camera.getPhoto with option saveToGallery set to true. The the system bottom sheet appears and I choose Take a photo, then the sheet disappears and nothing, I have to click the button again to call Camera.getPhoto and again choose Take a photo. But, if I set saveToGallery to false, everything works as expected. Also worth mentioning that after these manipulations camera opens from the first attempt until I restart the app.
I've tried disabling camera permissions and plugin doesn't ask any, I've tried manually request permissions but nothing pops up, I've tried manually enable permissions in settings and bug still presents. And one more thing, I've put console.log after await Camera.getPhoto and nothing appears in console on a first attempt when Camera didn't show off but on second my console.log has been fired.

I've been thinking maybe I should change versions for these things as Android studio suggests but I'm not sure whether to do it as Capacitor documentation says these versions should be set.
classpath 'com.google.gms:google-services:4.4.0'
classpath 'com.android.tools.build:gradle:8.2.1'
distributionUrl=https://services.gradle.org/distributions/gradle-8.2.1-all.zip

Capacitor dependencies
"@capacitor/android": "^6.1.2",
"@capacitor/app": "^6.0.1",
"@capacitor/camera": "^6.0.2",

Expected Behavior

Camera should open after first attempt.

Project Reproduction

I believe there is no need for such project but I can make it on request

Additional Information

No response

@jcesarmobile
Copy link
Member

The plugins Camera plugin is located in the capacitor-plugins repository (https://github.com/ionic-team/capacitor-plugins), you should report the issue there.

Also make sure you provide a sample app that reproduces the problem.

@jcesarmobile jcesarmobile closed this as not planned Won't fix, can't repro, duplicate, stale Oct 15, 2024
Copy link

ionitron-bot bot commented Nov 14, 2024

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Nov 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants