Ionic: Connection to server was unsuccessful

时间:2016-04-25 08:50:48

标签: cordova ionic-framework connection

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="*"/>

1 个答案:

答案 0 :(得分:2)

可能的问题:

  1. 检查设备是否位于同一Wi-Fi下。

  2. 检查防火墙是否未阻止8100和35729端口。

  3. 检查以下标记:

    fn f<T>(var: &T) where for<'a> T: Trait<'a> { let input = 0i32; let output = var.get_output(&input); }