I have a trouble about emulate app and ionic view

Hello guys. I’m devoloping ionic app because of my graduation dissertation and my presentation is monday. If you help me i will be very appreciate :slight_smile:

I have a big trouble about emulating my app in android. I want to add few place camera plugin for this reason i try to emulate but application is not working correctly as in browser. When i run my app with ionic serve there is no problem. I tried ionic run android --livereload and this is better than ionic run android but it’s also not working correctly as in browser. I read tens of topics about this issue but can’t find any solution. When i inspect android’s chrome console log error like this

ionic.bundle.js:25005 GET http://10.0.2.2/webservice/server/?a=get... net::ERR_CONNECTION_REFUSED

My index.html is

<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">
    <!-- 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="js/ng-cordova.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>
</head>
<body ng-app="starter">
    <!--
      The nav bar that will be updated as we navigate between views.
    -->
    <ion-nav-bar class="bar-stable" align-title="center">
    <ion-nav-back-button></ion-nav-back-button>
    </ion-nav-bar>

    <!--
      The views will be rendered in the <ion-nav-view> directive below
      Templates are in the /templates folder (but you could also
      have templates inline in this html file if you'd like).
    -->
    <ion-nav-view></ion-nav-view>
  </body>
  </html>

System information is

Cordova CLI: 7.0.1
Gulp Version: CLI version 3.9.1
Gulp local: Local verion 3.9.1
Ionic Framework Version: 2.0.0-rc.5
Ionic CLI Version: 2.1.0-beta.3
Ionic App Lib version: 2.1.0-beta.1
OS:
Node Version: v6.9.4

Hello, not sure it will help you, but Ionic 1 is fully deprectated, aka practically no one use it any more, the code is flagged as too old.
You can use ionic view, it will save your presentation (You can share your app to anyone mobile phone thanks to Ionic View). Learn how to use Ionic View here:

Also this is extremely bad documented, but to invite for example your teacher to ionic view, do that in CLI:
ionic invite name@name.com

and if emulate doesn’t work, ionic view will work. you can invite all your class too, but first you need to create a free account here in ionic cloud.

Hope it helps you

Thank you for your response. Like you said, i downloaded the ionic view and set it up now i can see my app into my ios phone better than the android emulate. When my app opened i am loged in via login page but after this there is no action when i click the screen. What is the problem i can’t figure out why my app not working on ionic view or emulate as in the chrome browser.

MMM, there must be a silent error in your code. In that kind of cases, in general it comes from an error inside your 2 starter files : app.component.ts, and app.module.ts.

Have a good check on both and make sure there is no plugin missing, invalid declaration of page, missing page, so on (yes if you forget to declare a new page in app.component.ts, it will crash silently).

Hope it helps,

I am using ionic v1 and there is no file like you said. I think this files in ionic v2

But your system information show Ionic 2?? I’m confused.

Ionic Framework Version: 2.0.0-rc.5
Ionic CLI Version: 2.1.0-beta.3
Ionic App Lib version: 2.1.0-beta.1
OS:
Node Version: v6.9.4

I solve the clicking problem in href part removed the ‘/’ beginning of the url and now its clicking works correctly. Hovewer this time my backend webservice not working

Did you remote debug the problem on the device already?
Follow these instructions here to debug the problem in Safari dev tools: https://ionic.zone/debug/remote-debug-your-app#ios
Follow these instructions here to debug the problem in Chrome dev tools: https://ionic.zone/debug/remote-debug-your-app#android
Look at the console and network tabs for errors.

I did in android emulator and error is

ionic.bundle.js:25005 GET http://10.0.2.2/webservice/server/?a=get... net::ERR_CONNECTION_REFUSED

In ionic view i don’t know how can i debug?

You don’t debug in Ionic View.

Find out why this connection is refused. Can you open the same URL in Safari or Chrome on the device? Does it tell you more in the console?

Again it says localhost refused to connect ERR_CONNECTION_REFUSED I read tens of pages about connection refused but i can’t find the solution

It’s not a debug matter @sujan12, the guy was not aware he is in Ionic 3 (told me in pm).

Actually my confusion is i followed ionic v1 tutorial in the beginning and after a while i installed ionic v2.

1 Like

@Aklis to my own advice. Ionic V1 is depecrecated for long. Now, you should move your core to V2 style. Like on ionic 3. My code has done all the discprecencies.

Have fun with Ionic :slight_smile:

1 Like