【发布时间】: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