開發環境:Cordova版本:6.x
安卓版本:6.0
解決方案一:
在config.xml中添加以下內容:
<preference name="LoadUrlTimeoutValue" value="70000"/>
解決方案二:
新建一個index.html,在里面添加如下內容:
其中main.html為原先的index.html
Reference:
http://stackoverflow.com/questions/23514622/cordova-connection-to-server-was-unsuccessful
https://cordova.apache.org/docs/en/latest/config_ref/index.html#preference