question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: Android 11 - Unable to resolve camera activity

See original GitHub issue

Bug 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
jcesarmobilecommented, Dec 9, 2020

If you target SDK 30, you have to add the intents your app queries in AndroidManifest.xml, in this case

<queries>
  <intent>
    <action android:name="android.media.action.IMAGE_CAPTURE" />
  </intent>
</queries>
0reactions
ionitron-bot[bot]commented, Nov 11, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android Camera intent not responding in Android 11
I am working with Camera Intent. Everything is working fine till Android 10, but in Android 11 I am getting result Code 0....
Read more >
[HELP] Camera won't work after Android 11 Update + Possible ...
Example 1: As soon as I launch google camera it just crashes. Example 2: Snapchat, instagram, or any other apps just give me...
Read more >
Behavior changes: all apps - Android Developers
The Android 12 platform includes behavior changes that may affect your app. The following behavior changes apply to all apps when they run...
Read more >
Capture and read bug reports - Android Developers
A bug report contains device logs, stack traces, and other diagnostic information to help you find and fix bugs in your app.
Read more >
Behavior changes: Apps targeting Android 11
Like earlier releases, Android 11 includes behavior changes that may affect your app. The following behavior changes apply exclusively to apps that are ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found