Shyamal Parikh
Shyamal Parikh

Reputation: 3068

Ionic: Connection to server was unsuccessful

When I try to run ionic app in emulator or device. I get the following error:

The connection to server was unsuccessful (http://192.168.0.8:8100)

However, it works alright in browser through ionic serve.

I hope it is not due to Content Security Tag or Cordova Whitelist plugin settings which are as follows:

<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'">

  <allow-navigation href="http://*/*"/>
  <access origin="*"/>

Upvotes: 1

Views: 1129

Answers (1)

Thiago Coelho
Thiago Coelho

Reputation: 101

Possible issues:

  1. Check if device is under the same Wi-Fi.

  2. Check if you firewall is not blocking 8100 and 35729 ports.

  3. Check the following tags:

    <content src="index.html"/> <access origin="*"/> <allow-navigation href="http://ionic.local/*"/> <allow-navigation href="*"/> <allow-navigation href="http://192.168.0.8:8100"/> <allow-intent href="http://*/*"/> <allow-intent href="https://*/*"/>

Upvotes: 2

Related Questions