Whitescreen after adding ngCordova: How do i add ngCordova correctly?

Hi Ionic-Forum,

I need help with the steps to add ngCordova to my ionic projekt for android devices. Specifically i want to use the $cordovaMedia to play sounds.

So far i

  • added the cordova media plugin (which shows up in the plugins folder)
  • included js/ng-cordova.js in index.html (between ionicbundle.js and cordova.js). File is placed in projectfolder/www/js/
  • i added a dependency to the app.js => angular.module(‘name’, [‘ionic’, ‘ngCordova’, ‘name.controllers’, ‘name.services’])
  • i tried adding the dependency to the controller module too => angular.module(‘name.controllers’, [‘ngCordova’])
  • and i added it the specific plugin to the controller => .controller(‘SendCtrl’, function($scope, $state, $http, $cordovaMedia, dataservice) {

i tested this on my android device (physical device), where it worked before adding ngCordova. Then i tested it as a local browser view (although as far as i understand it cordova plugins wont work in browser view).

my browser throws the following error:
“Uncaught Error: [$injector:modulerr] Failed to instantiate module farts due to:
Error: [$injector:modulerr] Failed to instantiate module ngCordova due to:
Error: [$injector:nomod] Module ‘ngCordova’ 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.”
=> not sure if this is relevant since cordova plugins should not work in browsers, right?

Any steps i’m missing? I read about $ionicReady to catch unitialized plugins, but i didnt understand it so far and im not sure if it matters, since i the only usage of the module beside the dependency injection is tied to a button click on a screen after the login screen.
Any advice is highly appreciated, this is the third sunday i’am trying to solve this.

Can anyone provide additional insight? Searched a lot through the web and tried everything i found, still no result.

Index.html:

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

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

apps.js:

angular.module('name', ['ionic', 'ngCordova', 'name.controllers', 'name.services'])

Errormessage:

Uncaught Error: [$injector:modulerr] Failed to instantiate module name due to:
Error: [$injector:modulerr] Failed to instantiate module ngCordova due to:
Error: [$injector:nomod] Module 'ngCordova' 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.

And your ng-cordova file is located here? I can’t see anything that you’re doing wrong…

The path to ng-cordova.js is: projectfolder\www\lib\ngCordova\dist
respective for the compiled android folder its: projectfolder\platforms\android\assets\www\lib\ngCordova\dist