I get this error. What should I do?
The path is valid and I\'ve checked it. And I\'ve made a clean and rebuilt the app again, and so forth. I really
i had this problem and i fixed it like this..
super.loadUrl("file:///android_asset/www/index.html");
to
super.loadUrl("file:///android_asset/www/index.htm");
Check your asset/www/ folder. Check the index.html file is there.
You might need to use IceCreamCordovaWebViewClient
@Override
public void init() {
super.init(webView, new IceCreamCordovaWebViewClient(this, webView), new CordovaChromeClient(this, webView));
}
I found a really good solution to this online.
What you basically need to do is to move the contents of index.html to another file, say app.html.
Then have the following code in your original index.html:
<!doctype html>
<html>
<head>
<title>your app name</title>
</head>
<body>
<script>
window.location='./app.html';
</script>
</body>
</html>
The connection to the server won't timeout anymore and the app should load successfully.
Now I didn't come up with this great idea. All credit goes to Robert Kehoe:
https://www.robertkehoe.com/2013/01/fix-for-phonegap-connection-to-server-was-unsuccessful/
Doing this helped me solve a similar problem with my own Android phonegap application...
Raj Patel answer works! should use super.loadUrl("file:///android_asset/www/index.html"); although the folder in called assets in eclipse
check your www folder, I think there is no index.hmtl in there