我在为 BlackBerry 平台构建应用程序方面拥有丰富的经验,目前正在尝试使用 PhoneGap (Cordova) 和 BlackBerry WebWorks 为 BlackBerry 10 Beta (QNX)< 部署示例应用程序 没有取得太大成功。我按照 PhoneGap Getting Started Guide for BlackBerry 上的说明进行操作指南,链接自他们的developer blog 。
在上述指南的第六步中,我遇到了一些无法找到 org.apache.cordova 功能以及所有 blackberry.* 功能的问题。 > 特点:
D:\Work\Development\PhoneGap\workspace\sample>ant qnx build
Buildfile: D:\Work\Development\PhoneGap\workspace\sample\build.xml
qnx:
build:
generate-cod-name:
[echo] Generated name: cordovaExample.bar
clean:
[delete] Deleting directory D:\Work\Development\PhoneGap\workspace\sample\build
package-app:
[mkdir] Created dir: D:\Work\Development\PhoneGap\workspace\sample\build\widget
[copy] Copying 24 files to D:\Work\Development\PhoneGap\workspace\sample\build\widget
[copy] Copying 1 file to D:\Work\Development\PhoneGap\workspace\sample\build\widget
[copy] Copying 1 file to D:\Work\Development\PhoneGap\workspace\sample\www\js
[zip] Building zip: D:\Work\Development\PhoneGap\workspace\sample\build\cordovaExample.zip
build:
[exec]
[exec] D:\Work\Development\PhoneGap\workspace\sample>"C:\Program Files\Research In Motion\BlackBerry 10 WebWorks SDK 1.0.2.9\dependencies\node\node.exe" "C
:\Program Files\Research In Motion\BlackBerry 10 WebWorks SDK 1.0.2.9\lib\bbwp.js" D:\Work\Development\PhoneGap\workspace\sample\build\cordovaExample.zip -o D:\
Work\Development\PhoneGap\workspace\sample\build
[exec] [INFO] Populating application source
[exec] [INFO] Parsing config.xml
[exec] [WARN] Build ID set in config.xml [version], but no signing password was provided [-g]. Bar will be unsigned
[exec] [WARN] Failed to find feature with id: org.apache.cordova
[exec] [WARN] Failed to find feature with id: blackberry.find
[exec] [WARN] Failed to find feature with id: blackberry.identity.phone
[exec] [WARN] Failed to find feature with id: blackberry.pim.Address
[exec] [WARN] Failed to find feature with id: blackberry.pim.Contact
[exec] [WARN] Failed to find feature with id: blackberry.io.file
[exec] [WARN] Failed to find feature with id: blackberry.utils
[exec] [WARN] Failed to find feature with id: blackberry.io.dir
[exec] [WARN] Failed to find feature with id: blackberry.app.event
[exec] [WARN] Failed to find feature with id: blackberry.system.event
[exec] [WARN] Failed to find feature with id: blackberry.widgetcache
[exec] [WARN] Failed to find feature with id: blackberry.media.camera
[exec] [WARN] Failed to find feature with id: blackberry.media.microphone
[exec] [INFO] Generating output files
[exec] [INFO] Info: Package created: D:\Work\Development\PhoneGap\workspace\sample\build\simulator\cordovaExample.bar
[exec] [INFO] Info: Package created: D:\Work\Development\PhoneGap\workspace\sample\build\device\cordovaExample.bar
[exec] [INFO] BAR packaging complete
BUILD SUCCESSFUL
Total time: 8 seconds
D:\Work\Development\PhoneGap\workspace\sample>
请注意,无法找到 org.apache.cordova 功能以及所有 blackberry.* 功能。
忽略警告并部署到 BB10 模拟器会导致此错误:i.imgur.com/aUcPM.png
需要注意的是,在为 PlayBook 而不是 BlackBerry 10 进行部署时,不会出现上述警告或执行错误。
如果能够提供任何指导来帮助解决此问题,我们将不胜感激。
非常感谢。
最佳答案
看来这些警告可以忽略,因为它成功打包了 bar 文件。找不到的blackberry.*功能似乎只有BlackBerry 7.0及以下版本需要。如果部署仅用于 BB10,则从 config.xml 中删除这些 blackberry.* 功能应该是安全的,但如果也将部署到较低版本,则最好保留它。
至于org.apache.cordova这一行,官方论坛的发帖者指出:
I think the WebWorks packager tries to find org.apache.cordova in the WebWorks SDK folder to copy it into the bar file, while in reality org.apache.cordova already exists in your www folder which is also being copied into the bar file. (Nevertheless I still think this line is still needed to access the Cordova API on the device)
关于cordova - PhoneGap (Cordova) + BlackBerry 10 QNX 与 Ant 的构建问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13550962/