{"id":1260,"date":"2022-08-30T15:15:03","date_gmt":"2022-08-30T15:15:03","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/10\/why-this-error-in-my-phonegap-for-android-app-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:15:03","modified_gmt":"2022-08-30T15:15:03","slug":"why-this-error-in-my-phonegap-for-android-app-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/why-this-error-in-my-phonegap-for-android-app-collection-of-common-programming-errors\/","title":{"rendered":"why this error in my phonegap for android app?-Collection of common programming errors"},"content":{"rendered":"<p>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 &#8230; 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<\/p>\n<p>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<\/p>\n<p>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<\/p>\n<pre><code>function onBodyLoad()\n{          \n    document.addEventListener(\"deviceready\",onDeviceReady,false);\n}\n\nfunction onDeviceReady()\n{    \n    document.addEventListener(\"resume\", onResume, false);\n    onResume();     \n}\n\nfunction onResume(){\n    openBrowser('http:\/\/www.mysite.com\/wap');  \n    \/\/navigator.app.exitApp();\n}\n\nfunction openBrowser(url){\n      \/\/ document.location= url;\n}\n<\/code><\/pre>\n<p>I was looking at other posts about similar errors and they all seem to suggest setting the java like so:<\/p>\n<pre><code>  public void onCreate(Bundle savedInstanceState) {\n    super.onCreate(savedInstanceState);\n    super.setStringProperty(\"loadingDialog\", \"Title,Message\"); \n    this.setIntegerProperty(\"loadUrlTimeoutValue\", 70000);\n\n   \/\/ setContentView(R.layout.main);\n    super.loadUrl(\"file:\/\/android_asset\/www\/index.html\");\n}\n<\/code><\/pre>\n<p>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<\/p>\n<ol>\n<li>\n<p>I needed three slashes after file: then it worked.<\/p>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2013-11-10 00:12:39. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>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 &#8230; 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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1260","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1260","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1260"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1260\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1260"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1260"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1260"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}