cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fabio Moretti (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CB-12831) java.io.FileNotFoundException when using camera plugin and FILE_URI
Date Thu, 18 May 2017 16:39:04 GMT

     [ https://issues.apache.org/jira/browse/CB-12831?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Fabio Moretti updated CB-12831:
-------------------------------
    Environment: 
Android 4.4.4 on Samsung SM-G850M
Android 6.0.1 on Xiaomi Redmi
Android 6 on Motorola

deploy environment:

global packages:

    @ionic/cli-utils : 1.1.2
    Cordova CLI      : 6.5.0 
    Ionic CLI        : 3.1.2

local packages:

    @ionic/cli-plugin-cordova : 1.1.2
    @ionic/cli-plugin-ionic1  : 1.1.2
    Ionic Framework           : unknown

cordova plugins:

cordova-plugin-app-event 1.2.0 "Application Events"
cordova-plugin-app-preferences 0.99.3 "AppPreferences"
cordova-plugin-camera 2.4.1 "Camera"
cordova-plugin-compat 1.1.0 "Compat"
cordova-plugin-console 1.0.5 "Console"
cordova-plugin-crosswalk-webview 2.3.0 "Crosswalk WebView Engine"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-dialogs 1.3.1 "Notification"
cordova-plugin-file 4.3.1 "File"
cordova-plugin-file-transfer 1.6.1 "File Transfer"
cordova-plugin-geolocation 2.4.1 "Geolocation"
cordova-plugin-inappbrowser 1.7.0 "InAppBrowser"
cordova-plugin-mauron85-background-geolocation 2.2.5 "CDVBackgroundGeolocation"
cordova-plugin-network-information 1.3.1 "Network Information"
cordova-plugin-sim 1.3.3 "SIM"
cordova-plugin-splashscreen 4.0.1 "Splashscreen"
cordova-plugin-statusbar 2.2.1 "StatusBar"
cordova-plugin-uniquedeviceid 1.3.1 "UniqueDeviceID"
cordova-plugin-vibration 2.1.3 "Vibration"
cordova-plugin-whitelist 1.3.1 "Whitelist"
cordova-sqlite-storage 2.0.2 "Cordova sqlite storage plugin"
de.appplant.cordova.plugin.local-notification 0.8.4 "LocalNotification"
ionic-plugin-keyboard 2.2.1 "Keyboard"
phonegap-plugin-push 1.9.4 "PushPlugin"


  was:
Android 4.4.4 on Samsung SM-G850M
Android 6.0.1 on Xiaomi Redmi
Android 6 on Motorola

    Description: 
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.myapp/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).


  was:
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).



> 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
> deploy environment:
> global packages:
>     @ionic/cli-utils : 1.1.2
>     Cordova CLI      : 6.5.0 
>     Ionic CLI        : 3.1.2
> local packages:
>     @ionic/cli-plugin-cordova : 1.1.2
>     @ionic/cli-plugin-ionic1  : 1.1.2
>     Ionic Framework           : unknown
> cordova plugins:
> cordova-plugin-app-event 1.2.0 "Application Events"
> cordova-plugin-app-preferences 0.99.3 "AppPreferences"
> cordova-plugin-camera 2.4.1 "Camera"
> cordova-plugin-compat 1.1.0 "Compat"
> cordova-plugin-console 1.0.5 "Console"
> cordova-plugin-crosswalk-webview 2.3.0 "Crosswalk WebView Engine"
> cordova-plugin-device 1.1.4 "Device"
> cordova-plugin-dialogs 1.3.1 "Notification"
> cordova-plugin-file 4.3.1 "File"
> cordova-plugin-file-transfer 1.6.1 "File Transfer"
> cordova-plugin-geolocation 2.4.1 "Geolocation"
> cordova-plugin-inappbrowser 1.7.0 "InAppBrowser"
> cordova-plugin-mauron85-background-geolocation 2.2.5 "CDVBackgroundGeolocation"
> cordova-plugin-network-information 1.3.1 "Network Information"
> cordova-plugin-sim 1.3.3 "SIM"
> cordova-plugin-splashscreen 4.0.1 "Splashscreen"
> cordova-plugin-statusbar 2.2.1 "StatusBar"
> cordova-plugin-uniquedeviceid 1.3.1 "UniqueDeviceID"
> cordova-plugin-vibration 2.1.3 "Vibration"
> cordova-plugin-whitelist 1.3.1 "Whitelist"
> cordova-sqlite-storage 2.0.2 "Cordova sqlite storage plugin"
> de.appplant.cordova.plugin.local-notification 0.8.4 "LocalNotification"
> ionic-plugin-keyboard 2.2.1 "Keyboard"
> phonegap-plugin-push 1.9.4 "PushPlugin"
>            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.myapp/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: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message