No virtual method getCamera() - Xamarin.AndroidX.Camera

VPrasanth 51 Reputation points


I need help in solving this issue.

I was using the CameraX sample from, and this repo is using older Xamarin.AndroidX.Camera.Core and other dependencies.

I had updated all AndroidX.Camera packages to the latest versions(, and getting the below error.
I need to set the custom ISO, custom exposure and white balance.
There is no option of setting the exposure etc in the older versions of the AndroidX.Camera packages, so I endedup in upgrading the packages.

Since then, am getting the below issue and no clue to fix this exception:

[MonoDroid] java.lang.NoSuchMethodError: No virtual method getCamera()Landroidx/camera/core/Camera; in class Landroidx/camera/core/SurfaceRequest; or its super classes (declaration of '' appears in /data/app/~~x4sngehli4tT62zv5UDu1g==/com.companyname.camerax-tb0zodG0-w9uEdnnsbO9AA==/base.apk)
[MonoDroid] at$createSurfaceProvider$1$PreviewView(
[MonoDroid] at$$Lambda$PreviewView$n1PRP3s6fDboGjmt9Yty7nYrFM0.onSurfaceRequested(Unknown Source:2)
[MonoDroid] at$sendSurfaceRequestIfReady$1(
[MonoDroid] at$$Lambda$Preview$ Source:4)
[MonoDroid] at android.os.Handler.handleCallback(
[MonoDroid] at android.os.Handler.dispatchMessage(
[MonoDroid] at android.os.Looper.loop(
[MonoDroid] at
[MonoDroid] at java.lang.reflect.Method.invoke(Native Method)
[MonoDroid] at$
[MonoDroid] at

Any idea of how to solve this?

A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,261 questions
0 comments No comments
{count} votes

Accepted answer
  1. Leon Lu (Shanghai Wicresoft Co,.Ltd.) 64,571 Reputation points Microsoft Vendor


    Welcome to our Microsoft Q&A platform!

    I try to download this simple, then I update all AndroidX.Camera packages to the latest versions(, And I run it in my android 9.0 and android 11 emulator, both of them are running normally without this exception. You can download my simple from this thread:

    Best Regards,

    Leon Lu

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

0 additional answers

Sort by: Most helpful