3 Replies Latest reply on Dec 20, 2016 12:19 AM by VectorP

    "Camera not defined" on adobe build; works fine on "ionic run android"


      I added the ngcordova camera plugin in my app. I've run it from the ionic cii (ionic run android) and built it from the private repo connected to my build project.  I used chrome://instpect/devices to debug.  When I install the app from the cli, I can take pictures with no problem and I get no errors from my camera controller code.  However, when I build and install from adobe build, the debugger shows that 'Camera is undefined'.  The 'takePicture' is from the camera example.  Again, it works fine if I side-load, but doesn't work if I do an adobe build and install from the QR link.


      Here's the sample.


      $scope.takePicture = function() {

        var options = {

         quality : 75,

         destinationType : Camera.DestinationType.DATA_URL,  <----- ERROR IS HERE

         sourceType : Camera.PictureSourceType.CAMERA,

         allowEdit : true,

         encodingType: Camera.EncodingType.JPEG,

         targetWidth: 300,

         targetHeight: 300,

         popoverOptions: CameraPopoverOptions,

         saveToPhotoAlbum: false,

         cameraDirection: 1,

         saveToPhotoAlbum: false


        $cordovaCamera.getPicture(options).then(function(imageData) {

        $scope.imgURI = "data:image/jpeg;base64," + imageData;

        $scope.newEntry.image = imageData;

        $scope.newEntry.showPicButton = false;

        $scope.newEntry.showForm = true;

        }, function(err) {

         console.log("error " + err);

         // An error occured. Show a message to the user