科尔多瓦与服务器的连接不成功

问题描述:

来连接服务器失败(文件:///android-asset/www/index.html)

是显示。
请让我知道如何解决这个问题。

is showing when i run my android application. please let me know how to resolve this issue.

这可能会在这里问了很多次..
这个问题可以通过添加超时web视图调用(的index.html)修复。在你project_name.java类只需添加此

This may asked here many times.. This issue can fix by adding a timeout to the webview call (index.html). In your project_name.java class just add this

 super.setIntegerProperty("loadUrlTimeoutValue", 5000);

和科尔多瓦最新的,只要使用此超时

And in Cordova latest, just use this to timeout

 super.loadUrl(Config.getStartUrl(), 5000);

另外通过这些所谓的问题

Also go through these so questions

Question1

Question2

更新:

还有一个解决办法,试试这个

One more solution, try this

创建一个main.html中,把你的code那里,并在您的index.html只是重定向到main.html中

Create a main.html and put your code there, and in your index.html just redirect to main.html

<script>
 window.location='./main.html';
</script>