电容器相机在 Android 上投掷 "Unable to create photo on disk" 5

Capacitor Camera throwing "Unable to create photo on disk" on Android 5

电容相机插件在 Android 8+ 设备上运行良好,但出于某种原因,它在 [=26] 上的三星 Tab A(SM-T280) 运行 上抛出以下错误=] 5.

配置

const image = await Plugins.Camera.getPhoto({
  quality: 100,
  allowEditing: false,
  resultType: CameraResultType.Base64,
  source: CameraSource.Camera
});

错误

这个问题是因为没有创建目录造成的。

解决这个问题的方法是在 this code in the repo. The answer is referenced from cordova-camera-plugin code

之后添加 storageDir.mkdirs();

此问题已在 Pull Request #2016

中解决