UncaughtReference error with phoneGap android-Collection of common programming errors
I’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("deviceready", onDeviceReady, false);
}
// device APIs are available
//
function onDeviceReady() {
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail);
}
....gotFS() code.....
function fail(evt) {
console.log(evt.target.error.code);
}
Example
Read File
res/xml/config.xml
Hello Cordova
A sample Apache Cordova application that responds to the deviceready event.
Apache Cordova Team
Manifest
Main Activity.java
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
package com.example.hello;
import android.os.Bundle;
import org.apache.cordova.*;
public class testApp extends DroidGap
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
// Set by in config.xml
super.loadUrl(Config.getStartUrl());
//super.loadUrl("file:///android_asset/www/index.html")
}
}
Some one Please help!!…I am new to phone Gap ..Stuck on this since hours