hoping that someone could understand this, they fought this question all day. I am trying to browse folders in the file system to select a file, but I cannot connect to the file system.
When I call "window.requestFileSystem", the error callback returns a "Class not found" error. Turning to the Cordoba requestFileSystem function, I notice that the βClass not foundβ is returned during the call to exec () (where I cannot trace it). Has anyone overcame this problem or knew how to fix it? I know that it is listed in several forums, but the fixes offered there do not work for me.
As far as I can see, all the plugins are there. Installed using the Cordova CLI, they are displayed in the plugin folder. I really wonder if the plugin is uploaded, and not sure how I can verify this.
- org.apache.cordova.console
- org.apache.
- cordova.device org.apache.cordova.file
- org.apache.cordova.file transfer
Www / index.html
<body onload="onLoad();">
<script type="text/javascript">
function onLoad(){document.addEventListener('deviceready', init, true);}
function init(){
window.requestFileSystem(1, 0, function(fileSystem){
alert('success');
}, function(e){
alert('Error accessing local file system');
});
}
</script>
<div class="app">
<h1>Apache Cordova</h1>
...
</div>
<script type="text/javascript" src="cordova.js"></script>
</body>
config.xml
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.fwd.cwptakeonsheetsv1" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>CWPTakeOnSheetsV1</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
</description>
<author email="dev@cordova.apache.org" href="http://cordova.io">
Apache Cordova Team
</author>
<content src="index.html" />
<access origin="*" />
<feature name="App">
<param name="android-package" value="org.apache.cordova.App" />
</feature>
<feature name="Device">
<param name="android-package" value="org.apache.cordova.device.Device" />
</feature>
<feature name="File">
<param name="android-package" value="org.apache.cordova.file" />
<param name="android-package" value="org.apache.cordova.file.FileUtils" />
<param name="onload" value="true" />
<param name="android-package" value="org.apache.cordova.FileUtils" />
</feature>
<feature name="FileTransfer">
<param name="android-package" value="org.apache.cordova.filetransfer.FileTransfer" />
</feature>
</widget>
Cordoba requestFileSystem.js
var requestFileSystem = function(type, size, successCallback, errorCallback) {
argscheck.checkArgs('nnFF', 'requestFileSystem', arguments);
var fail = function(code) {
errorCallback && errorCallback(new FileError(code));
};
if (type < 0) {
fail(FileError.SYNTAX_ERR);
} else {
var success = function(file_system) {
if (file_system) {
if (successCallback) {
var result = new FileSystem(file_system.name, file_system.root);
successCallback(result);
}
}
else {
fail(FileError.NOT_FOUND_ERR);
}
};
exec(success, fail, "File", "requestFileSystem", [type, size]);
}
};