In your config.xml file add this line:
<preference name="loadUrlTimeoutValue" value="700000" />
As you said, there are many duplicate questions on the same topic. Any how explaining your situation.
The problem might be solved by adding a timeout to call your index.html
ie you need to add super.setIntegerProperty("loadUrlTimeoutValue", 70000);
in your activity.java file ( inside src/com/yourProj/--/youractivity.java)
above this line: super.loadUrl("file:///android_asset/www/index.html");
Explanation:
This can be happened due to the following reasons
The core reason: the problem is likely due to the speed of the emulator so the network is too slow complete the communication in a timely fashion.
This can be due to:
Here is the working solution
create a new page main.html
example:
<!doctype html>
<html>
<head>
<title>tittle</title>
<script>
window.location='./index.html';
</script>
</head>
<body>
</body>
</html>
change the following in mainactivity.java
super.loadUrl("file:///android_asset/www/index.html");
to
super.loadUrl("file:///android_asset/www/main.html");
Now build your application and it works on any slow connection
refernce.
NOTE: This is a workaround I found in 2013.
Please remove remotely linked jQuery files such as:
https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js
Instead, download this file and load it from your local js folder, making the URI:
js/jquery.min.js
Remove the external scripts in your index.html
Change this:
<script src="http://code.highcharts.com/highcharts-more.js"></script>
to
<script src="project_folder/highcharts-more.js"></script>
I had a similar issue and based on above suggestions I first added "super.setIntegerProperty("loadUrlTimeoutValue", 70000);" but that did not help. So I tried Project -> Clean, that worked and I can launch the app now !
Avinash...
Try this,
1.Rename your index.html to “main.html”
2.Create a new “index.html” and put the following content into it:
<!doctype html> <html> <head> <title>tittle</title> <script> window.location='./main.html'; </script> <body> </body> </html>
3.Rebuild your app! No more errors!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With