Javascript Cordova文件插件没有';行不通
我正在我的项目中使用Javascript Cordova文件插件没有';行不通,javascript,android,html,cordova,Javascript,Android,Html,Cordova,我正在我的项目中使用cordova 5.1.1。我在cordova_plugins.js中声明了文件插件: { "file": "plugins/cordova-plugin-file/www/FileSystem.js", "id": "cordova-plugin-file.FileSystem", "clobbers": [ "window.FileSystem" ] }, 但是当我尝试使用这样的插件时: window.requestFil
cordova 5.1.1
。我在cordova_plugins.js
中声明了文件插件:
{
"file": "plugins/cordova-plugin-file/www/FileSystem.js",
"id": "cordova-plugin-file.FileSystem",
"clobbers": [
"window.FileSystem"
]
},
但是当我尝试使用这样的插件时:
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0,
onFileSystemSuccess, fail);
我得到:
Uncaught ReferenceError: LocalFileSystem is not defined
没有响应侦听器,因此没有加载文件插件,这就是为什么您会
Uncaught ReferenceError: LocalFileSystem is not defined
添加此项并在其中包含您的请求:
document.addEventListener("deviceready", function() {
//use request file here
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0,
onFileSystemSuccess, fail);
}, false);
复制品?不,我已经成功安装了文件插件,并且在cordova_plugins.js上声明了该插件。他们的解决方案与我的问题无关,而是与:
filesystem.getFile(“readme.txt”,{create:true,exclusive:false},gotFileEntry,fail1)代码>我获取:找不到方法android.content.Context.getExternalMediaDirs,该方法引用自方法org.apache.cordova.file.LocalFilesystem.isPublicDirectory