2

我在为 BlackBerry 平台构建应用程序方面经验丰富,目前正在尝试使用PhoneGap (Cordova)和 BlackBerry WebWorks 为BlackBerry 10 Beta (QNX)部署示例应用程序,但没有取得多大成功。我正在按照PhoneGap Getting Started Guide for BlackBerry指南中的说明进行操作,该指南链接自他们的开发人员博客

在上述指南的第六步,我遇到了一些无法找到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 时,不会出现上述警告或执行错误。

如果可以提供任何指导来帮助解决此问题,我们将不胜感激。

非常感谢你。

4

2 回答 2

3

似乎可以忽略这些警告,因为它成功打包了 bar 文件。找不到的 blackberry.* 功能似乎只有 BlackBerry 7.0 及以下版本才需要。如果部署仅用于 BB10,则从 config.xml 中删除那些 blackberry.* 功能应该是安全的,但如果它也将部署到较低版本,则最好保留它。

至于 org.apache.cordova 这条线,官方论坛的一张海报说:

我认为 WebWorks 打包程序试图在 WebWorks SDK 文件夹中找到 org.apache.cordova 以将其复制到 bar 文件中,而实际上 org.apache.cordova 已经存在于您的 www 文件夹中,该文件夹也被复制到 bar 文件中。(尽管如此,我仍然认为访问设备上的 Cordova API 仍然需要这条线)

于 2012-11-28T02:06:39.607 回答
0

您看到警告的原因是因为 BlackBerry 10 不支持某些 'blackberry.*' API,所以它只是跳过它们。我相信这与您的屏幕截图无关。

您如何尝试准确访问联系人,您有任何示例代码吗?

于 2012-11-27T02:44:46.783 回答