{"id":2924,"date":"2014-03-10T12:56:48","date_gmt":"2014-03-10T12:56:48","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/10\/uncaughtreference-error-with-phonegap-android-collection-of-common-programming-errors\/"},"modified":"2014-03-10T12:56:48","modified_gmt":"2014-03-10T12:56:48","slug":"uncaughtreference-error-with-phonegap-android-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/10\/uncaughtreference-error-with-phonegap-android-collection-of-common-programming-errors\/","title":{"rendered":"UncaughtReference error with phoneGap android-Collection of common programming errors"},"content":{"rendered":"<p>I&#8217;m getting a<\/p>\n<pre><code>07-26 18:39:21.741: E\/Web Console(15885): Uncaught ReferenceError: LocalFileSystem is not defined at file:\/\/\/android_asset\/www\/index.html:18\n<\/code><\/pre>\n<p>While using a simple phoneGAp app which is equipped to handle File IO from the Device<\/p>\n<p><strong>Index.html<\/strong><\/p>\n<pre><code>    \n\n  \n    FileReader Example\n\n    \n    \n\n    \/\/ Wait for device API libraries to load\n    \/\/\n    function onLoad() {\n        document.addEventListener(\"deviceready\", onDeviceReady, false);\n    }\n\n    \/\/ device APIs are available\n    \/\/\n    function onDeviceReady() {\n        window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail);\n    }\n\n....gotFS() code.....\n\n    function fail(evt) {\n        console.log(evt.target.error.code);\n    }\n\n    \n  \n  \n    <\/code><\/pre>\n<h1><code>Example<\/code><\/h1>\n<pre>\n    <br \/>Read File\n  \n\n<\/pre>\n<p><code><strong>res\/xml\/config.xml<\/strong><\/code><\/p>\n<pre><code><code>   \n\n    Hello Cordova\n    \n\n    \n        A sample Apache Cordova application that responds to the deviceready event.\n    \n    \n        Apache Cordova Team\n    \n    \n    \n        \n    \n    \n    \n    \n    \n    \n\n<\/code><\/code><\/pre>\n<p><strong>Manifest<\/strong><\/p>\n<pre><code>\n\n    \n    \n    \n    \n        \n            \n                \n                \n            \n        \n    \n    \n\n<\/code><\/pre>\n<p>Main Activity.java<\/p>\n<pre><code>\/*\n       Licensed to the Apache Software Foundation (ASF) under one\n       or more contributor license agreements.  See the NOTICE file\n       distributed with this work for additional information\n       regarding copyright ownership.  The ASF licenses this file\n       to you under the Apache License, Version 2.0 (the\n       \"License\"); you may not use this file except in compliance\n       with the License.  You may obtain a copy of the License at\n\n         http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\n       Unless required by applicable law or agreed to in writing,\n       software distributed under the License is distributed on an\n       \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n       KIND, either express or implied.  See the License for the\n       specific language governing permissions and limitations\n       under the License.\n *\/\n\npackage com.example.hello;\n\nimport android.os.Bundle;\nimport org.apache.cordova.*;\n\npublic class testApp extends DroidGap\n{\n    @Override\n    public void onCreate(Bundle savedInstanceState)\n    {\n        super.onCreate(savedInstanceState);\n        \/\/ Set by  in config.xml\n        super.loadUrl(Config.getStartUrl());\n        \/\/super.loadUrl(\"file:\/\/\/android_asset\/www\/index.html\")\n    }\n}\n<\/code><\/pre>\n<p>Some one Please help!!&#8230;I am new to phone Gap ..Stuck on this since hours<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m getting a 07-26 18:39:21.741: E\/Web Console(15885): Uncaught ReferenceError: LocalFileSystem is not defined at file:\/\/\/android_asset\/www\/index.html:18 While using a simple phoneGAp app which is equipped to handle File IO from the Device Index.html FileReader Example \/\/ Wait for device API libraries to load \/\/ function onLoad() { document.addEventListener(&#8220;deviceready&#8221;, onDeviceReady, false); } \/\/ device APIs are available [&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-2924","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2924","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=2924"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2924\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=2924"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=2924"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=2924"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}