I need help to solve this problem
Please share the code you are using, as well as the platform (Android, iOS), device or simulator details, etc.
This is an old post but I am getting this error on Android only, with Capacitor v4.6.2 an @capacitor/camera@4.1.4. iOS works fine
I am using javascript (not an ionic App)
My simple code is this:
function takePhoto() {
var image = document.getElementById("myImage").src;
return Capacitor.Plugins.Camera.getPhoto({
quality: 100, // 0-100
source: 'CAMERA', // Prompt | Camera | Photos
saveToGallery: true,
resultType: 'uri'
}).then(function(result) {
const scannedImages = result.webPath;
if (scannedImages) {
const scannedImage = document.getElementById('myImage');
if (scannedImage) {
scannedImage.src = Capacitor.convertFileSrc(scannedImages[0]);}
localStorage.setItem("imageSrc", scannedImage.src);
}
});
}
I get the error even if I set saveToGallery: false,
.
this is the error:
Uncaught (in promise) Error: Unable to create photo on disk
at returnResult ((index):747:32)
at win.androidBridge.onmessage ((index):722:21)
Any help would be appreciated