【问题标题】:Ionic Capacitor Camera plugin build error in AndroidAndroid中的离子电容器相机插件构建错误
【发布时间】:2022-10-20 22:28:22
【问题描述】:

我正在尝试使用电容器/相机插入。但是代码在为 Android 构建时失败。

这是我调用相机意图的函数:

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;
  };

这是我面临的构建错误:

我的环境版本:


npm: 8.17.0

node: 18.7.0

angular: 14.0.5

ionic: 6.20.1

@camera/capacitor: 4.1.0

【问题讨论】:

    标签: android angular ionic-framework camera capacitor


    【解决方案1】:

    插件似乎有一些问题,或者 jetify 没有涵盖某些内容。 我也有同样的问题。 试试这个https://ionicframework.com/docs/native/camera 这对我有用

    【讨论】:

      猜你喜欢
      • 2021-04-26
      • 1970-01-01
      • 1970-01-01
      • 2022-10-25
      • 2015-11-16
      • 2017-02-05
      • 1970-01-01
      • 2017-05-17
      相关资源
      最近更新 更多