Ionic not loading cordova.js file


#1

I am having a problem with my ionic project, it is not loading cordova.js file or ngCordova.js file.

Here is my index.html file

<!DOCTYPE html>
<html>
 <head>
  <script src="lib/ngCordova/dist/ng-cordova.js"/>
  <script src="cordova.js"></script>
  <script type='text/javascript' src="lib/cryptojslib/rollups/aes.js"></script>
  ...
 </head>
</html>

When I deploy the app on my iphone, aes.js and cordova.js file is loaded, the problem is ng-cordova.js is not loaded because when I invoke that code I get:

Error: Can't find variable: cordova
scan@file:///var/containers/Bundle/Application/6888FB51-F164-46EC-89AC-B8960C93FC7A/Nastic.app/www/lib/ngCordova/dist/ng-cordova.js:596:16\
....

If I switch lines:

<!DOCTYPE html>
<html>
  <head>
    <script src="cordova.js"></script>
    <script src="lib/ngCordova/dist/ng-cordova.js"/>
    <script type='text/javascript' src="lib/cryptojslib/rollups/aes.js"></script>
    ...
  </head>
</html>

Then ng-cordova.js is loaded, but aes.js is not loaded.

I was looking for a fix to this problem but couldn’t find anything that solved the issue, however lot of similar issues.

Thanks