App works in Browser, IOS/Android Emulator, but not on Android Device. App.Run/App.Config never run


#1

Hello Ionic Forum!,

I have a simple “simon says” like application.

This app works in the browser, in the IOS simulator, and the android emulator.

However when installing the debug APK onto the device, the index.html loads (confirmed with alerts after every script tag), but the angular app never starts up. Take the following piece of code:
`

alert('In app.js')
angular.module('starter', ['ionic', 'ionic-native-transitions', 'js-data', 'ngStorage', 'ngAudio', 'chart.js', 'starter.controllers', 'starter.services']).run(function ($ionicPlatform) {
  alert('Start Run');
    $ionicPlatform.ready(function () {
       alert('Start Ready');

`

When the app launches in my nexus 6p, I immediately see In app.js, but neither of the either alerts, nor the one I put in angular.config.

When using ionic run android, the console shows no errors. I also see no errors when building the package either.

Any help is greatly appreciated!

-straghunath


#2

@straghunath
Sir I also have the same problem . If you have the solution please response ASAP.
Thanks…


#3

Please also post your index.html code…


#4

@fabioferrero

Firstly Thanks for Response.

Sir

Details Regarding used Ionic Framework

C:\Users\hp>ionic info

Your system information:

ordova CLI: 6.4.0
Ionic CLI Version: 2.1.17
Ionic App Lib Version: 2.1.7
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 7
Node Version: v6.9.2
Xcode version: Not installed

*Problem: *Sir, actually I have used the Target API 24 for Android Ionic
App and I have android mobile(Redmi 3s mobile) of same API 24. Build APK
file is running on emulator of same API but when I install it on my
mobile phone and run the app ,it shows only index.html content on Screen .
But when I install it on my another mobile phone(Micromax mobile phone)
, it smoothly run as on emulator and mobile phone give the right output of
apk file.

Sir, Please give me solution as soon as possible

Thanks

*Note: Index.html *file is attached please check.


#5

@fabioferrero

index.html code is below

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


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

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

<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<script src="lib/ionic-material/dist/ionic.material.min.js"></script>
<link href="lib/ionic-material/dist/ionic.material.min.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=RobotoDraft%3A400%2C500%2C700%2C400italic" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<style type="text/css">
  .platform-ios .manual-ios-statusbar-padding{
    padding-top:20px;
  }
  .manual-remove-top-padding{
    padding-top:0px;
  }
  .manual-remove-top-padding .scroll{
    padding-top:0px !important;
  }
  ion-list.manual-list-fullwidth div.list, .list.card.manual-card-fullwidth {
    margin-left:-10px;
    margin-right:-10px;
  }
  ion-list.manual-list-fullwidth div.list > .item, .list.card.manual-card-fullwidth > .item {
    border-radius:0px;
    border-left:0px;
    border-right: 0px;
  }
</style>

<script src="js/app.js"></script>
<script src="js/controllers.js"></script>
<script src="js/routes.js"></script>
<script src="js/services.js"></script>
<script src="js/directives.js"></script>
<!--#5. indexCtrl -->
<ion-side-menus  ng-controller="indexCtrl" data-componentid="side-menu21" style="" enable-menu-with-back-views="false">
    <ion-side-menu-content  >
        <ion-nav-bar class="bar-assertive" >

            <ion-nav-back-button></ion-nav-back-button>


            <ion-nav-buttons side="left">
                <!-- #3.  $root.extras -->
                <button ng-if="$root.extras" class="button button-icon button-clear ion-navicon" menu-toggle="left">
                </button>
            </ion-nav-buttons>

            <ion-nav-buttons side="right">
              <!-- #3.  $root.extras -->
              <!-- #4.  get_total() -->
              <button ui-sref="myCart" ng-if="$root.extras" class="button button-icon button-clear ion-ios-cart-outline">
                {{get_total()}}
              </button>
            </ion-nav-buttons>

        </ion-nav-bar>
        <ion-nav-view></ion-nav-view>
    </ion-side-menu-content>

    <!-- #3.  $root.extras -->
    <ion-side-menu side="left" id="side-menu21" ng-if="$root.extras">

        <ion-header-bar class="expanded">
          <img ng-src="{{&apos;img/fk/&apos;+ user_info.photoURL +&apos;.jpg&apos;}}" class="avatar motion spin fade">
          <div class="menu-bottom">
            {{user_info.displayName}}
          </div>
        </ion-header-bar>

        <ion-content class="stable-bg has-expanded-header">
            <ion-list data-componentid="list1" class=" " id="menu-list1">

                <ion-item data-componentid="list-item1" style="" menu-close="" ui-sref="menu2" id="menu-list-item1" class="item-icon-left  ">
                    <i class="icon ion-ios-home-outline"></i>Menu</ion-item>
                <ion-item data-componentid="list-item2" style="" menu-close="" ui-sref="offers" id="menu-list-item2" class="item-icon-left  ">
                    <i class="icon ion-ios-pricetag-outline"></i>Offers</ion-item>
                <ion-item data-componentid="list-item8" style="" menu-close="" ui-sref="myCart" id="menu-list-item8" class="item-icon-left  ">
                    <i class="icon ion-ios-cart-outline"></i>My Cart</ion-item>
                <ion-item data-componentid="list-item3" style="" menu-close="" ui-sref="lastOrders" id="menu-list-item3" class="item-icon-left  ">
                    <i class="icon ion-ios-clock-outline"></i>Orders</ion-item>
                <ion-item data-componentid="list-item4" style="" menu-close="" ui-sref="favourite" id="menu-list-item4" class="item-icon-left  ">
                    <i class="icon ion-ios-star-outline"></i>Favourite</ion-item>
                <ion-item data-componentid="list-item5" style="" menu-close="" ui-sref="settings" id="menu-list-item5" class="item-icon-left  ">
                    <i class="icon ion-ios-gear-outline"></i>Settings</ion-item>
                <ion-item data-componentid="list-item6" style="" menu-close="" ui-sref="support" id="menu-list-item6" class="item-icon-left  ">
                    <i class="icon ion-ios-help-outline"></i>Support</ion-item>
                <ion-item ng-click="logout()" data-componentid="list-item7" style="" id="menu-list-item7" class="item-icon-left  ">
                    <i class="icon ion-log-out"></i>Logout</ion-item>
            </ion-list>
        </ion-content>

    </ion-side-menu>
</ion-side-menus>

#6

…sorry but, index.html is not complete, please post your line…


#8

sorry… html was stripped, please post your body line…


#9

Here is Body Line

<!--#5. indexCtrl -->
<ion-side-menus  ng-controller="indexCtrl" data-componentid="side-menu21" style="" enable-menu-with-back-views="false">
    <ion-side-menu-content  >
        <ion-nav-bar class="bar-assertive" >

            <ion-nav-back-button></ion-nav-back-button>


            <ion-nav-buttons side="left">
                <!-- #3.  $root.extras -->
                <button ng-if="$root.extras" class="button button-icon button-clear ion-navicon" menu-toggle="left">
                </button>
            </ion-nav-buttons>

            <ion-nav-buttons side="right">
              <!-- #3.  $root.extras -->
              <!-- #4.  get_total() -->
              <button ui-sref="myCart" ng-if="$root.extras" class="button button-icon button-clear ion-ios-cart-outline">
                {{get_total()}}
              </button>
            </ion-nav-buttons>

        </ion-nav-bar>
        <ion-nav-view></ion-nav-view>
    </ion-side-menu-content>

    <!-- #3.  $root.extras -->
    <ion-side-menu side="left" id="side-menu21" ng-if="$root.extras">

        <ion-header-bar class="expanded">
          <img ng-src="{{&apos;img/fk/&apos;+ user_info.photoURL +&apos;.jpg&apos;}}" class="avatar motion spin fade">
          <div class="menu-bottom">
            {{user_info.displayName}}
          </div>
        </ion-header-bar>

        <ion-content class="stable-bg has-expanded-header">
            <ion-list data-componentid="list1" class=" " id="menu-list1">

                <ion-item data-componentid="list-item1" style="" menu-close="" ui-sref="menu2" id="menu-list-item1" class="item-icon-left  ">
                    <i class="icon ion-ios-home-outline"></i>Menu</ion-item>
                <ion-item data-componentid="list-item2" style="" menu-close="" ui-sref="offers" id="menu-list-item2" class="item-icon-left  ">
                    <i class="icon ion-ios-pricetag-outline"></i>Offers</ion-item>
                <ion-item data-componentid="list-item8" style="" menu-close="" ui-sref="myCart" id="menu-list-item8" class="item-icon-left  ">
                    <i class="icon ion-ios-cart-outline"></i>My Cart</ion-item>
                <ion-item data-componentid="list-item3" style="" menu-close="" ui-sref="lastOrders" id="menu-list-item3" class="item-icon-left  ">
                    <i class="icon ion-ios-clock-outline"></i>Orders</ion-item>
                <ion-item data-componentid="list-item4" style="" menu-close="" ui-sref="favourite" id="menu-list-item4" class="item-icon-left  ">
                    <i class="icon ion-ios-star-outline"></i>Favourite</ion-item>
                <ion-item data-componentid="list-item5" style="" menu-close="" ui-sref="settings" id="menu-list-item5" class="item-icon-left  ">
                    <i class="icon ion-ios-gear-outline"></i>Settings</ion-item>
                <ion-item data-componentid="list-item6" style="" menu-close="" ui-sref="support" id="menu-list-item6" class="item-icon-left  ">
                    <i class="icon ion-ios-help-outline"></i>Support</ion-item>
                <ion-item ng-click="logout()" data-componentid="list-item7" style="" id="menu-list-item7" class="item-icon-left  ">
                    <i class="icon ion-log-out"></i>Logout</ion-item>
            </ion-list>
        </ion-content>

    </ion-side-menu>
</ion-side-menus>

#10

nope :frowning:
…try again, how do you start your app? you use body ng-app?