Phonegap: timeout error causing webviewclient

I am trying to debug a phonegap application. When I try to open the application on my emulator, I get the error message The connection to the server was unsuccessful. (file:///android_asset/www/index.html) The connection to the server was unsuccessful. (file:///android_asset/www/index.html)

I should mention that I use the phonegap assembly, so I don't have my own code. It is strange that I only load local resources, so I do not understand why I get a timeout. My index.html is as follows:

 <!DOCTYPE html> <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width" /> <title>Mængderabat - spar mere</title> <script src="http://debug.phonegap.com/target/target-script-min.js#maengderabat"></script> <script src="phonegap.js" charset="utf-8"></script> <script src="assets/js/jquery-1.5.2.min.js"></script> <script src="assets/js/jquery.mobile.js"></script> <script src="assets/js/jquery.jfeed.pack.js"></script> <link rel="stylesheet" href="assets/css/jquery.mobile.css" /> <style> .ui-li-icon{width:16px;height:16px;} </style> </head> <body > <!-- begin first page --> <section id="main" data-role="page" data-theme="b"> <header data-role="header"> <h1>Mængderabat - spar mere</h1> </header> <div data-role="content" class="content"> <ul id="list" data-role="listview" data-inset="true"> </ul> </div> <footer data-role="footer"> <h2>example by Oikos Development</h2> </footer> </section> <!-- end first page --> </body> </html> 
+4
source share
2 answers

Increase the timeout in the main (telephone) activity:

 setIntegerProperty("loadUrlTimeoutValue", 30000); 
+1
source

I am not very good at building PhoneGap, but is your jQuery path true? I think it will be js / jquery * if there is a js folder in your www folder.

In addition, you download a remote resource from debug.phonegap.com. Perhaps this slows you down.

0
source

Source: https://habr.com/ru/post/1395299/


All Articles