Search code examples
blackberryantcordovablackberry-webworks

PhoneGap Blackberry build error. The system cannot find the file specified


I am new to using PhoneGap and am trying to setup the example app, i'm using PhoneGap version 2.9.0 and apache-ant-1.9.1.

I have configured apache ant, installed the WebWorks SDK and have setup the project.properties file.

The error seems to be that it cannot find the 'CordovaExample' file in the temporary folder, i have checked the folder and it has the following files in it: 'CordovaExample.jdp', 'CordovaExample.jdw' and 'CordovaExample.rapc' (among various others). Am i missing some configuration so that it should search for one of these 3 files, instead of just 'CordovaExample'?

The error is shown below when the 'ant blackberry build' command is run:

jamest@JT1 /c/Development/FirstApp
$ ant blackberry build
Buildfile: c:\Development\FirstApp\build.xml

blackberry:

build:

generate-cod-name:
     [echo] Generated name: CordovaExample.cod

clean:
   [delete] Deleting directory c:\Development\FirstApp\build

package-app:
    [mkdir] Created dir: c:\Development\FirstApp\build\widget
     [copy] Copying 22 files to c:\Development\FirstApp\build\widget
      [zip] Building zip: c:\Development\FirstApp\build\CordovaExample.zip

build:
     [exec] [INFO]                      Parsing command line options
     [exec] [INFO]                      Parsing bbwp.properties
     [exec] [INFO]                      Validating application archive
     [exec] [INFO]                      Parsing config.xml
     [exec] [INFO]                      Populating application source
     [exec] [INFO]                      Compiling BlackBerry WebWorks application
     [exec] I/O Error: C:\Users\jamest\AppData\Local\Temp\widgetGen.584154969137
3014448670.tmp\CordovaExample (The system cannot find the file specified)
     [exec] [ERROR]                     RAPC exception occurred

BUILD SUCCESSFUL
Total time: 8 seconds

I've searched the web, but can't find any similar questions so any help would be much appreciated.

Thanks


Solution

  • Ensure that you are using JDK 6 and NOT JDK 7 - WebWorks requires that version according to the BB support forums:

    Please note that you need JDK6 (32-bit) to be installed and referenced by the tools. Based on the sample it seems to be referencing JDK7.

    If you do not require JDK7 explicitly, the safest option is to uninstall all existing JDK/JREs from your PC (this includes both 64-bit and 32-bit) versions from Program Files and Program Files (x86); respectively. And then install only JDK6 (which automatically includes the JRE) that is 32-bit.

    Apparently you might even need a specific build of JDK 6:

    I noticed that JDK1.6 build 43 had the same behaviour during the packaging process [...]

    I had to roll back to JDK1.6 build 30 before I could sign and package my webworks apps again.