Cordova Camera not instantiating

Cross - Post :

I’m trying to implement a Camera Application with Ionic Framework and Cordova and struggling to understand why it’s throwing out the following errors and thus unable to instantiate the camera:

  0     444468   error    Uncaught SyntaxError: Unexpected token .,, Line: 9
  1     444540   error    Uncaught Error: [$injector:modulerr] Failed to instantiate module starter due to:
  Error: [$injector:nomod] Module 'starter' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.

The following question and answers unfortunately didn’t help me in answering my question:

I have referred to the following tutorials to get this job done with no success(sometimes I got confused more):

The following is my code:


<!DOCTYPE html>
    <meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'">
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">


<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">

<!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
<link href="css/" rel="stylesheet">

<!-- ionic/angularjs js -->
<script src="lib/ionic/js/ionic.bundle.js"></script>

<!-- cordova script (this will be a 404 during development) -->
<script src="cordova.js"></script>

<!-- your app's js -->
<script src="js/app.js"></script>
 <body ng-app="starter">
  <ion-header-bar class="bar-assertive">
    <h1 class="title">Title of App</h1>
  <ion-content ng-controller="CameraCtrl">
    <div class="list card"
    <div class="item item-image">
      <img ng-src="{{pictureUrl}}">
  <div class="padding">
    <button ng-click="takePicture()"
    class="button button-block button-assertive">Take a Photo</button>


 // Ionic Starter App

    angular.module('starter', ['ionic', 'ngCordova']);

  .controller('CameraCtrl', function($scope, $cordovaCamera) {

   $scope.pictureUrl = '';

   $scope.takePicture = function() {
      .then(function(data) {
       console.log('camera data': + angular.toJson(data));
      }, function(error) {
        console.error('camera error': + angular.toJson(data));


  .run(function($ionicPlatform) {
   $ionicPlatform.ready(function() {
     if(window.cordova && window.cordova.plugins.Keyboard) {
     if(window.StatusBar) {

Thank you in advance for all your help!

and you have correctly added the cordova-plugin for that?:

cordova plugin add

Apologies for the late reply.

Actually added the more recent version of Cordova Camera Plugin.