Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Platform :cannot connect to localhost:4200 #105

Closed
kithokit opened this issue Dec 13, 2014 · 7 comments
Closed

Android Platform :cannot connect to localhost:4200 #105

kithokit opened this issue Dec 13, 2014 · 7 comments

Comments

@kithokit
Copy link

Hi after building the android platform on ember-cli-cordova
When I ember server up running the app, the android simulator shows error message
cannot connect to localhost:4200

Have u ever meet this issue as well?

@jakecraige
Copy link
Contributor

I haven't used the Android simulator much personally, but I have some insight into what could be causing this.

When you have the live reload option enabled, it redirects to localhost:4200 on start up. This works in the iOS simulator on the same computer, but it's possible it doesn't in the Android one. There is a configurable emberUrl you can set to tell it your computer's IP so it can redirect there instead of localhost.

If that doesn't work, next can try disabling the liveReload option just to make sure that is the problem

@kithokit
Copy link
Author

cordova: {
      rebuildOnChange: false,
      emulate: true,
      emberUrl: "192.168.11.4:4200",
      liveReload: {
        enabled: false,
        platform: 'ios'
      }
    }

Here is my config/environment.js
I have disabled the liveReload options
but the same

screen shot 2014-12-14 at 12 44 28 am

Not sure what's the cause.
Not sure it is underlineing problem of android simulator with emberjs

@jakecraige
Copy link
Contributor

Also, make sure you've ran ember cdv:build --platform=android if you didn't. Then reload it in the simulator

Is the app working in your browser?

@kithokit
Copy link
Author

I have tried an works now. To solve this, i have to remote the attribute

liveReload: {
        enabled: false,
        platform: 'ios'
      }

in config/environments.js

So, btw, does liveReload support on Android platform now?

@jakecraige
Copy link
Contributor

It should work but I haven't tried it in awhile. If you set it to enabled, and set the platform to "android" you can give it a shot :)

@adamesque
Copy link

FYI this doesn't appear to work currently, at least not with Android 5.1 — if I enable LiveReload, as soon as the app boots on the device, I get dumped out to Chrome, which tries to load the emberUrl URL in my config.

@alexblom
Copy link
Contributor

I think this is a duplicate of #174. Please open again if that is not the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants