sencha touch with phonegap(使用 sencha cmd 和 phonegap build)导致错误:LocalFileSystem 未定义 [英] sencha touch with phonegap (using sencha cmd and phonegap build) causes Error : LocalFileSystem not defined

查看:27
本文介绍了sencha touch with phonegap(使用 sencha cmd 和 phonegap build)导致错误:LocalFileSystem 未定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照这些 sencha cmd 指南制作了一个基于 phoneGap 的 sencha touch 2 项目:使用最新的 Sencha Cmd v4.0.2.67,最新的 sencha touch 2.3.1,phoneGap ver- 3.1.0

I followed these sencha cmd guide to produce a phoneGap based sencha touch 2 project: Using Latest Sencha Cmd v4.0.2.67 , Latest sencha touch 2.3.1 , phoneGap ver- 3.1.0

1) 通过以下方式制作 sencha touch 2 项目:

1) Make a sencha touch 2 project by :

sencha -sdk /path/to/sencha-touch-sdk generate app MyApp /path/to/www/myapp

2)在上面的项目中添加phoneGap

2) Add phoneGap to the above project

sencha phonegap init

3)配置phonegap.local.properties

3) configure the phonegap.local.properties

phonegap.platform=android
phonegap.build.remote=true
phonegap.build.remote.username=myUseName
phonegap.build.remote.password=myPassword

4) 通过添加所有核心插件更新 config.xml

4) Updated the config.xml by adding all the core plugins

<!-- Core plugins -->
    <gap:plugin name="org.apache.cordova.battery-status" />
    <gap:plugin name="org.apache.cordova.camera" />
    <gap:plugin name="org.apache.cordova.media-capture" />
    <gap:plugin name="org.apache.cordova.console" />
    <gap:plugin name="org.apache.cordova.contacts" />
    <gap:plugin name="org.apache.cordova.device" />
    <gap:plugin name="org.apache.cordova.device-motion" />
    <gap:plugin name="org.apache.cordova.device-orientation" />
    <gap:plugin name="org.apache.cordova.dialogs" />
    <gap:plugin name="org.apache.cordova.file" />
    <gap:plugin name="org.apache.cordova.file-transfer" />
    <gap:plugin name="org.apache.cordova.geolocation" />
    <gap:plugin name="org.apache.cordova.globalization" />
    <gap:plugin name="org.apache.cordova.inappbrowser" />
    <gap:plugin name="org.apache.cordova.media" />
    <gap:plugin name="org.apache.cordova.network-information" />
    <gap:plugin name="org.apache.cordova.splashscreen" />
    <gap:plugin name="org.apache.cordova.vibration" />

并删除了

5) Created a external js file named dirReader.js and included its path in app.json

5) 创建一个名为 dirReader.js 的外部 js 文件并将其路径包含在 app.json 中

dirReader.js Contents

dirReader.js 内容

6) Added 'Ext.device.FileSystem' in requires under app.js        

6) 在 app.js 下的 requires 中添加 'Ext.device.FileSystem'

7) Finally ran sencha app build native This causes many mumbo jumbo to take place in the command prompt (No Errors) . the app is compressed and uploaded to build.phonegap for android build. Build succeeds.

7) 最后运行sencha app build native这会导致在命令提示符 (No Errors) 中出现许多 mumbo jumbo.该应用程序被压缩并上传到 build.phonegap for android build.构建成功.

----------------------------------------------------------------------------------------

-------------------------------------------------------------------------------------

问题

应用安装并正常启动.我从 dirReader.js 文件收到设备就绪"警报.我得到的下一个错误是 dirReader.js 中的 LocalFileSystem 未定义.

The app installs and starts fine. I receive the "Device Ready" alert from the dirReader.js file. The next error I get is that LocalFileSystem is undefined in dirReader.js.

我尝试了很多东西,但没有任何效果.

I tried lots of things but nothing works.

我检查了构建的 apk 是否包含包含所有插件的 plugins 文件夹,包括 org.apache.cordova.file .此外,cordova_plugins.js 存在并且具有 window.LocalFileSystem 条目.

I checked that the built apk contains the plugins folder with all the plugins including the org.apache.cordova.file . Also , the cordova_plugins.js is present and has the window.LocalFileSystem entry.

推荐答案

我在某处看到了同样的问题..cordova_plugin.js 是否包含

I saw somewhere the same issue.. is the cordova_plugin.js contain

{
    "file": "plugins/org.apache.cordova.core.file/www/FileSystem.js",
    "id": "org.apache.cordova.core.file.FileSystem",
    "clobbers": [
        "window.FileSystem"
    ]
},

您是否尝试使用 >cordova build android

did you try build with >cordova build android

您可以调用任何其他 API 方法吗?

can you call to any other API method?

这篇关于sencha touch with phonegap(使用 sencha cmd 和 phonegap build)导致错误:LocalFileSystem 未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆