Ionic Capacitor Camera plugin build error in Android

Viewed 52

I am trying to select photos using the Capacitor/Camera plugin. But the code fails while building for Android.

this is my function to call the camera Intent:

import { Camera, CameraResultType } from '@capacitor/camera';

 async takePicture() {
    const image = await Camera.getPhoto({
      quality: 90,
      allowEditing: true,
      resultType: CameraResultType.Uri
    });

    // image.webPath will contain a path that can be set as an image src.
    // You can access the original file using image.path, which can be
    // passed to the Filesystem API to read the raw data of the image,
    // if desired (or pass resultType: CameraResultType.Base64 to getPhoto)
    this.avatarUrl = image.webPath;
  };

This is the build error I am facing:

enter image description here

My Environment version:


npm: 8.17.0

node: 18.7.0

angular: 14.0.5

ionic: 6.20.1

@camera/capacitor: 4.1.0
0 Answers
Related