Fabio Moretti created CB-12831:
----------------------------------
Summary: java.io.FileNotFoundException when using camera plugin
and FILE_URI
Key: CB-12831
URL: https://issues.apache.org/jira/browse/CB-12831
Project: Apache Cordova
Issue Type: Bug
Components: cordova-plugin-camera
Affects Versions: 7.0.0
Environment: Android 4.4.4 on Samsung SM-G850M
Android 6.0.1 on Xiaomi Redmi
Android 6 on Motorola
Reporter: Fabio Moretti
Priority: Critical
I'm using cordova camera plugin for taking photos and I'm getting a
FileNotFoundException, my code is:
[...]
var options = {
destinationType: Camera.DestinationType.FILE_URI,
sourceType: Camera.PictureSourceType.CAMERA,
encodingType: Camera.EncodingType.JPEG,
quality: 50,
allowEdit: false,
saveToPhotoAlbum: false,
correctOrientation: true
};
$cordovaCamera.getPicture(options).then(function (imageData) {
$scope.fotoActualData = imageData;
console.log("*** CAMERA PLUGIN IMAGE DATA "+imageData);
}, function (err) {
console.log("*** CAMERA PLUGIN ERROR");
console.log(err);
});
[...]
the camera pop up, take the photo, but then in the log appear:
E/JHEAD (16513): can't open
'/storage/emulated/0/Android/data/com.tecytal.clientesapp/cache/.Pic.jpg'
E/CameraLauncher(16513): Exception while getting input stream:
java.io.FileNotFoundException:
/storage/emulated/0/Android/data/com.myapp/cache/.Pic.jpg: open failed: ENOENT
(No such file or directory)
D/CameraLauncher(16513): I either have a null image path or bitmap
W/CordovaPlugin(16513): Attempted to send a second callback for ID:
Camera552716950
W/CordovaPlugin(16513): Result was: "Unable to create bitmap!"
It seems it fails to open the image (anyway, the imaged is saved on the phone,
I can open it from the gallery).
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]