why this error in my phonegap for android app?-Collection of common programming errors
When run in the emulator (using phonegap 1.1.0, mac 10.6, eclipse 3.7.1) I get this error: 12-01 11:49:12.936: D/chromium(1062): Unknown chromium error: -6 … 12-01 11:49:13.476: I/System.out(1062): onReceivedError: Error code=-1 Description=A network error occurred. URL=file://android_asset/www/index.html
and on a device I get this error: 12-01 11:50:37.644: I/System.out(5319): onReceivedError: Error code=-14 Description= The requested file was not found. /android_asset/www/index.html (No such file or directory) URL=file://android_asset/www/index.html
My app is just a bare bones demo type app, so far the only code in it is this javascript in the index.html file
function onBodyLoad()
{
document.addEventListener("deviceready",onDeviceReady,false);
}
function onDeviceReady()
{
document.addEventListener("resume", onResume, false);
onResume();
}
function onResume(){
openBrowser('http://www.mysite.com/wap');
//navigator.app.exitApp();
}
function openBrowser(url){
// document.location= url;
}
I was looking at other posts about similar errors and they all seem to suggest setting the java like so:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.setStringProperty("loadingDialog", "Title,Message");
this.setIntegerProperty("loadUrlTimeoutValue", 70000);
// setContentView(R.layout.main);
super.loadUrl("file://android_asset/www/index.html");
}
or something like that, but it has been no help so far. Why am I getting these errors and what can I do about them? Thanks
-
I needed three slashes after file: then it worked.
Originally posted 2013-11-10 00:12:39.