bug: Android 11 - Unable to resolve camera activity
See original GitHub issueBug Report
Capacitor Version
💊 Capacitor Doctor 💊
Latest Dependencies:
@capacitor/cli: 2.4.2
@capacitor/core: 2.4.2
@capacitor/android: 2.4.2
@capacitor/electron: 2.4.2
@capacitor/ios: 2.4.2
Installed Dependencies:
@capacitor/electron not installed
@capacitor/cli 2.1.0
@capacitor/core 2.4.2
@capacitor/android 2.4.2
@capacitor/ios 2.4.2
Platform(s)
- Android
Current Behavior
Setting on android studio compileSdkVersion and targetSdkVersion to 30 (android 11) results in the exception mentioned everytime the camera tries to open. Reverting to version 29 (android 10) camera works as expected,
Expected Behavior
Open front/rear facing camera and take picture
Code Reproduction
const image = await Plugins.Camera.getPhoto({ quality: 60, allowEditing: false, resultType: CameraResultType.DataUrl, source: CameraSource.Prompt })
Other Technical Details
npm --version
output: 6.14.6
node --version
output: v12.18.4
Additional Context
ERROR Error: Uncaught (in promise): Error: Unable to resolve camera activity Error: Unable to resolve camera activity at Object.fromNative (capacitor-runtime.js:226) at <anonymous>:1:18 at T (polyfills-es2015.ecc57152156a3ef652c7.js:1) at polyfills-es2015.ecc57152156a3ef652c7.js:1 at a (main-es2015.962c5164b39c7ec6b75d.js:1) at l.invoke (polyfills-es2015.ecc57152156a3ef652c7.js:1) at Object.onInvoke (main-es2015.962c5164b39c7ec6b75d.js:1) at l.invoke (polyfills-es2015.ecc57152156a3ef652c7.js:1) at i.run (polyfills-es2015.ecc57152156a3ef652c7.js:1) at polyfills-es2015.ecc57152156a3ef652c7.js:1 at l.invokeTask (polyfills-es2015.ecc57152156a3ef652c7.js:1) at Object.onInvokeTask (main-es2015.962c5164b39c7ec6b75d.js:1)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top GitHub Comments
If you target SDK 30, you have to add the intents your app queries in
AndroidManifest.xml
, in this caseThanks 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.