JavaScript objects not loaded without "-lc" parameter


#1

Hello,

I try to run my application on Android emulator and real device. When I run it with command “ionic run android -lc” it works like a charm! But when I run command without parameters “ionic run android” my application fires exceptions on JavaScript objects:

D/SystemWebChromeClient(7944): file:///android_asset/www/js/app.js: Line 14 : Uncaught ReferenceError: jQuery is not defined

Please tell me why there is a dependency on parameters “-lc”?

My environment is

index.html:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">

    <title></title>

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

    <!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
    <link href="css/ionic.app.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>

    <script src="//code.jquery.com/jquery-1.12.4.min.js"></script>
     
    <!-- your app's js -->
    <script src="js/app.js"></script>
    <script src="js/controllers.js"></script>
    <script src="js/services.js"></script>    
    <script src="js/constants.js"></script>
    
  </head>

  <body ng-app="starter" ng-controller="AppCtrl">

    <!-- Angular Material requires Angular.js Libraries -->
    <!-- <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js"></script> -->
    <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-animate.min.js"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-aria.min.js"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-messages.min.js"></script>

    <!-- Angular Material Library -->
    <script src="http://ajax.googleapis.com/ajax/libs/angular_material/1.1.0/angular-material.min.js"></script>

    <ion-nav-bar class="bar-positive">
    </ion-nav-bar>

    <ion-nav-view class="background"></ion-nav-view>
  </body>

</html>

app.js

angular.module('starter', ['ionic', 'ui.router', 'ngMaterial'])

.run(function($ionicPlatform) {
  $ionicPlatform.ready(function() {

  // A $( document ).ready() block.
  jQuery(document).ready(function() {
    console.log( "!!!!!!!!!!!!!!!!!!!!!!!!!! ready! !!!!!!!!!!!!!!!!!!!!!" );
  });

    if(window.StatusBar) {
      StatusBar.styleDefault();
    }

  });
})

ionic info (project is ionic-v1):

Your system information:

Cordova CLI: 7.0.1 
Ionic CLI Version: 2.2.3
Ionic App Lib Version: 2.2.1
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 3.16
Node Version: v7.4.0
Xcode version: Not installed

#2

I have no idea at all, but this looked odd to me:

Tried with http://?


#3

Thanks, Sujan12! This helped! I fixed a little typo and now my application works! )))