Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Contributor
janot
Posts: 12
Registered: ‎02-20-2013
My Device: Dev Alpha B
My Carrier: unknown
Accepted Solution

Error when “cordova emulate blackberry10”

[ Edited ]

It produces following output:
   

    Generating config.xml from defaults for platform "blackberry10"
        Preparing blackberry10 project
        Running on emulator for platform "blackberry10" via command "cmd" /c "project_root"\platforms\blackberry10\cordova\run --emulator
        [Error: An error occurred while emulating/deploying the blackberry10 project.
        fs.js:418
          binding.open(pathModule._makeLong(path),
                  ^
        TypeError: path must be a string
            at Object.fs.open (fs.js:418:11)
            at Object.fs.readFile (fs.js:206:6)
            at _self.findConnectedSimulator ("project_root"\PLATFO~1\BLACKB~1\cordova\lib\target-utils.js:182:12)
            at Object.async.series.ip ("project_root"\PLATFO~1\BLACKB~1\cordova\lib\run:111:21)
            at "project_root"\PLATFO~1\BLACKB~1\cordova\node_modules\async\lib\async.js:561:25
            at iterate ("project_root"\PLATFO~1\BLACKB~1\cordova\node_modules\async\lib\async.js:131:13)
            at Object.async.eachSeries ("project_root"\PLATFO~1\BLACKB~1\cordova\node_modules\async\lib\async.js:147:9)
            at Object.async.series ("project_root"\PLATFO~1\BLACKB~1\cordova\node_modules\async\lib\async.js:560:19)
            at getTargetName ("project_root"\PLATFO~1\BLACKB~1\cordova\lib\run:108:15)
            at fn ("project_root"\PLATFO~1\BLACKB~1\cordova\node_modules\async\lib\async.js:579:34)
        ]


`cordova build blackberry10` is working normally. Emulator is also working normally.

 

Thanks

Please use plain text.
Administrator
astanley
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Error when “cordova emulate blackberry10”

Seems to me like a bug in cordova.  Can you confirm which version are you using?

 

This is the error shown "TypeError: path must be a string", and I don't like the look of the following recurring 'path' being used. It looks like cordova is not assembling the correct path for some reason.

 

"project_root"\PLATFO~1\BLACKB~1\cordova\node_modules\async\lib\async

 Which OS are you using (Win7 / Mac / etc) ? I'm curious if there is an environmentat path issue at hand here that's messing this up?

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Please use plain text.
Contributor
janot
Posts: 12
Registered: ‎02-20-2013
My Device: Dev Alpha B
My Carrier: unknown

Re: Error when “cordova emulate blackberry10”

I use cordova 3.1.0-0.2.0 on Win 8.1 x64.

"I'm curious if there is an environmentat path issue at hand here that's messing this up?" -  I'm not sure that I've clearly understood this question (looks like assumption).

Please use plain text.
BlackBerry Development Advisor
bryanhiggins
Posts: 190
Registered: ‎12-18-2012
My Device: Z10, Q10, Q5, Z30, Z3
My Carrier: Bell

Re: Error when “cordova emulate blackberry10”

Hi,

 

Do you mind sharing the full path to your project?

 

You could also check to see if this is resolved in 3.2.0-RC1:

 

npm install -g cordova@3.2.0-rc.1

Bryan Higgins
BlackBerry WebWorks
@bryanhiggins
Please use plain text.
Contributor
janot
Posts: 12
Registered: ‎02-20-2013
My Device: Dev Alpha B
My Carrier: unknown

Re: Error when “cordova emulate blackberry10”

Here is full path to my project

C:\_my_folder\_developing\workspace\Crossplatform\phonegap\ProjectName

I've tried “cordova emulate blackberry10” again, and now (I don't know why) I receive following error instead of that I mentioned in first post:

 

Generating config.xml from defaults for platform "blackberry10"
Preparing blackberry10 project
Running on emulator for platform "blackberry10" via command "cmd" /c C:\_my_folder\_developing\workspace\Crossplatform\phonegap\ProjectName\platforms\blackberry10\cordova\run --emulator
[Error: An error occurred while emulating/deploying the blackberry10 project. '"\node.exe"' is not recognized as an internal or external command,
operable program or batch file.
]

 

I've tried "node" - it works -> environment Path variable is correct

After that I've tried npm install -g cordova@3.2.0-rc.1 as you suggested - no changes (same error)

Please use plain text.
BlackBerry Development Advisor
bryanhiggins
Posts: 190
Registered: ‎12-18-2012
My Device: Z10, Q10, Q5, Z30, Z3
My Carrier: Bell

Re: Error when “cordova emulate blackberry10”

Just to eliminate any problems in your project, could you try creating a new one using 3.2-RC1?

 

Make sure your simulator is started before running emulate.

 

What output do you get for "where node" ?

Bryan Higgins
BlackBerry WebWorks
@bryanhiggins
Please use plain text.
BlackBerry Development Advisor
bryanhiggins
Posts: 190
Registered: ‎12-18-2012
My Device: Z10, Q10, Q5, Z30, Z3
My Carrier: Bell

Re: Error when “cordova emulate blackberry10”

I have an update for you. The "/node" issue was reported elsewhere and it turns out the environment variable settings for Windows are not correct on some systems.

 

You should edit init.bat which is under <your project>\platforms\blackberry10\cordova.

 

Change %HOME% to %USERPROFILE%

 

https://github.com/apache/cordova-blackberry/commit/3c5c5d01b3668f2bd2f19b40b2e645bac2e629a3

Bryan Higgins
BlackBerry WebWorks
@bryanhiggins
Please use plain text.
Contributor
janot
Posts: 12
Registered: ‎02-20-2013
My Device: Dev Alpha B
My Carrier: unknown

Re: Error when “cordova emulate blackberry10”

When doing "where node: I get path to node.exe:
C:\_my_folder\_developing\soft\other\nodejs\node.exe
Simulator is running before "cordova emulate blackberry10"

I've created new test project for clarity:
npm install -g cordova@3.2.0-rc.1
phonegap create bbtest
cd bbtest
cordova platform add blackberry10
change %HOME% to %USERPROFILE% in init.bat in <your project>\platforms\blackberry10\cordova
cordova emulate blackberry10

 

Output:


Generating config.xml from defaults for platform "blackberry10"
Preparing blackberry10 project
Running on emulator for platform "blackberry10" via command "cmd" /c C:\_my_folder\_developing\workspace\Crossplatform\phonegap\bbtest\platforms\blackberry10\cordova\run --emulator
[Error: An error occurred while emulating/deploying the blackberry10 project. WARNING: BlackBerry ID tokens can now be used in place of your old signing keys.
For more information log in at http://developer.blackberry.com and click on Code
 Signing

fs.js:418
  binding.open(pathModule._makeLong(path),
          ^
TypeError: path must be a string
    at Object.fs.open (fs.js:418:11)
    at Object.fs.readFile (fs.js:206:6)
    at _self.findConnectedSimulator (C:\_MY_FO~1\_DEVEL~1\WORKSP~1\CROSSP~1\phonegap\bbtest\PLATFO~1\BLACKB~1\cordova\lib\target-utils.js:184:12)
    at Object.async.series.ip (C:\_MY_FO~1\_DEVEL~1\WORKSP~1\CROSSP~1\phonegap\bbtest\PLATFO~1\BLACKB~1\cordova\lib\run-utils.js:46:17)
    at C:\_MY_FO~1\_DEVEL~1\WORKSP~1\CROSSP~1\phonegap\bbtest\PLATFO~1\BLACKB~1\cordova\node_modules\async\lib\async.js:561:25
    at iterate (C:\_MY_FO~1\_DEVEL~1\WORKSP~1\CROSSP~1\phonegap\bbtest\PLATFO~1\BLACKB~1\cordova\node_modules\async\lib\async.js:131:13)
    at Object.async.eachSeries (C:\_MY_FO~1\_DEVEL~1\WORKSP~1\CROSSP~1\phonegap\bbtest\PLATFO~1\BLACKB~1\cordova\node_modules\async\lib\async.js:147:9)
    at Object.async.series (C:\_MY_FO~1\_DEVEL~1\WORKSP~1\CROSSP~1\phonegap\bbtest\PLATFO~1\BLACKB~1\cordova\node_modules\async\lib\async.js:560:19)
    at Object.getTargetName (C:\_MY_FO~1\_DEVEL~1\WORKSP~1\CROSSP~1\phonegap\bbtest\PLATFO~1\BLACKB~1\cordova\lib\run-utils.js:43:15)
    at fn (C:\_MY_FO~1\_DEVEL~1\WORKSP~1\CROSSP~1\phonegap\bbtest\PLATFO~1\BLACKB~1\cordova\node_modules\async\lib\async.js:579:34)
]

Please use plain text.
BlackBerry Development Advisor
bryanhiggins
Posts: 190
Registered: ‎12-18-2012
My Device: Z10, Q10, Q5, Z30, Z3
My Carrier: Bell

Re: Error when “cordova emulate blackberry10”

OK, thanks for testing that. The error tells me that it cannot find your DHCP leases file for VMWare.

 

Do you have a BB10 simulator installed and running?

 

I've logged an issue with Apache to improve the output for this scenario:

https://issues.apache.org/jira/browse/CB-5448

Bryan Higgins
BlackBerry WebWorks
@bryanhiggins
Please use plain text.
Contributor
janot
Posts: 12
Registered: ‎02-20-2013
My Device: Dev Alpha B
My Carrier: unknown

Re: Error when “cordova emulate blackberry10”

Yes, it's installed and running.

"blackberry-deploy -installApp" woks normally

I've also checked that this error ocurrs even when wrong simulator ip is set.

 

Please use plain text.