title: PhoneGap Camera , Cannot read property 'getPicture' of undefined
body: <p>I am trying to get the Camera API to work in my PhoneGap android app, but i keep getting this error </p>
  
  <blockquote>
    <p>"Cannot read property 'getPicture' of undefined".</p>
  </blockquote>
  
  <p>Now i have checked countless answers on StackOverflow and tutorials all over the web,and tried all the answer there(with no luck), and i cant seem to find the issue.</p>
  
  <p>This is the button that calls the function</p>
  
  <pre><code>&lt;button type="button" class="btn btn-primary" ng-click="getPic()"&gt;Camera&lt;/button&gt;
  </code></pre>
  
  <p>This is the controller that handles the camera</p>
  
  <pre><code>myApp.controller('EditProfileCtrl', function ($scope, $http, navigateFactory) {
  $scope.getPic = function () {
      navigator.camera.getPicture(onSuccess, onFail, {
          quality: 60,
          destinationType: Camera.DestinationType.DATA_URL,
          sourceType: 1
      });
      function onSuccess(imageData) {
          var image = document.getElementById('myImage');
          image.src = "data:image/jpeg;base64," + imageData;
      }
      function onFail(message) {
          alert('Failed beause' + message);
      }
  };
  });
  </code></pre>
  
  <p>Please comment if there is any additional information required.
  Any and all help will be hugely appreciated.</p>
  
  <p>EDIT: So after following Aravin's advice i added <code>&lt;script src="cordova.js"&gt;&lt;/script&gt;</code>
  now it atleast looks like something is happening, but now im getting these errors in my eclipse logcat:</p>
  
  <blockquote>
    <p>I/System.out(3871): Error adding plugin
    org.apache.cordova.CameraLauncher  D/PluginManager(3871): exec() call
    to unknown plugin: Camera</p>
  </blockquote>