You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "dev at watch2web.com" <de...@watch2web.com> on 2014/01/23 07:24:37 UTC

reverted cordova version -- now build fails on HelloCordova

Following the docs, I did:

> npm install -g cordova@3.0.3

It seemed to work: cordova -v gives 3.0.3

I crreated a simple HelloCordova app:

> cordova create HelloCordova com.notacompany.test HelloCordova
> cd HelloCordova
> codova platform add android
> cd platforms\android  (Windows build)
> cordova build android --debug

I get immediate error:

>>> [TypeError: Cannot read property 'parser' of undefined]

There is probably a simple reason, but I could use some help finding it. 


Re: reverted cordova version -- now build fails on HelloCordova

Posted by "dev at watch2web.com" <de...@watch2web.com>.
Thanks to all who responded -- Josh, Braden, and Andrew. Just knowing about 
node-inspector and to look at the node-cache will surely help me going 
forward.

As it turns out, I think there is a bug in the 3.0.3 CLI. The immediate 
source of the error is in node_modules/cordova/src/prepare.js -- the 
platform list passed in includes options, so when the line 
platforms[p].parser(...) is executed on line 68 with p==--debug,...

I'm sure this is fixed in later versions, and I'm not going to risk breaking 
something else trying to fix it properly myself, so my work-around is to 
only invoke 'cordova build android' without options, and then hand edit 
PROJECT_ROOT/platforms/android/cordova/build.bat, appending the build type 
option to the command there. It's a little ugly, but not inconvenient.

I sincerely appreciate the help. Yesterday was a bad day -- I was hit by at 
least three other "nasty surprise" issues. By evening, I was very tired.

Andrew

----- Original Message ----- 
From: "Josh Soref" <js...@blackberry.com>
To: <de...@cordova.apache.org>
Sent: Thursday, 23 January, 2014 11:44
Subject: Re: reverted cordova version -- now build fails on HelloCordova


Braden wrote:
>At a glance, it sounds like your bug might be caused by having a newer
>cordova-android cached than 3.0.3 is expecting, causing the build and run
>scripts to fail. Try deleting $HOME/.cordova/lib, and recreating the test
>project.

On Windows, that should be %USERPROFILE%\.cordova\lib

In general, installing node-inspector is the right starting point:

 npm install node-inspector
 node node_modules\node-inspector\bin\inspector.js

Then in another window, node --debug-brk cordova-cli\bin\cordova
And then use Chrome to load the url that inspector.js references.

---------------------------------------------------------------------
This transmission (including any attachments) may contain confidential 
information, privileged material (including material protected by the 
solicitor-client or other applicable privileges), or constitute non-public 
information. Any use of this information by anyone other than the intended 
recipient is prohibited. If you have received this transmission in error, 
please immediately reply to the sender and delete this information from your 
system. Use, dissemination, distribution, or reproduction of this 
transmission by unintended recipients is not authorized and may be unlawful.



Re: reverted cordova version -- now build fails on HelloCordova

Posted by Josh Soref <js...@blackberry.com>.
Braden wrote:
>At a glance, it sounds like your bug might be caused by having a newer
>cordova-android cached than 3.0.3 is expecting, causing the build and run
>scripts to fail. Try deleting $HOME/.cordova/lib, and recreating the test
>project.

On Windows, that should be %USERPROFILE%\.cordova\lib

In general, installing node-inspector is the right starting point:

 npm install node-inspector
 node node_modules\node-inspector\bin\inspector.js

Then in another window, node --debug-brk cordova-cli\bin\cordova
And then use Chrome to load the url that inspector.js references.

---------------------------------------------------------------------
This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.


Re: reverted cordova version -- now build fails on HelloCordova

Posted by Braden Shepherdson <br...@chromium.org>.
Unfortunately there are no such documents. I think the best references for
how the CLI works overall are my brain, and Anis' brain. Someday we should
write down an overview.

At a glance, it sounds like your bug might be caused by having a newer
cordova-android cached than 3.0.3 is expecting, causing the build and run
scripts to fail. Try deleting $HOME/.cordova/lib, and recreating the test
project.


It's also possible that the Android cordova/build script was simply broken
in 3.0.3; I can't remember for certain that far back.

Braden


On Thu, Jan 23, 2014 at 2:00 PM, dev at watch2web.com <de...@watch2web.com>wrote:

> Unfortunately, I wanted to revert to 3.0.3 because the latest was causing
> me some other issues. I know I'll have to deal with them later, but for now
> I just need to be productive.
>
> Cordova 3.0.3 was working fine for me yesterday morning. But after
> installing the latest and reverting, it is broken. I can do bug hunting
> myself, but I'm new to node.js, and I don't know the design of the CLI as
> well as you. Are there any spec docs I can work from that will help me
> understand what is going on?
>
>
> ----- Original Message ----- From: "Andrew Grieve" <ag...@chromium.org>
> To: "dev" <de...@cordova.apache.org>
> Sent: Thursday, 23 January, 2014 05:19
> Subject: Re: reverted cordova version -- now build fails on HelloCordova
>
>
>
>  Probably you hit a bug in 3.0.3. Try updating to the latest version of the
>> tool and see if the bug is fixed.
>>
>>
>> On Thu, Jan 23, 2014 at 1:24 AM, dev at watch2web.com <dev@watch2web.com
>> >wrote:
>>
>>  Following the docs, I did:
>>>
>>>  npm install -g cordova@3.0.3
>>>
>>>>
>>>>
>>> It seemed to work: cordova -v gives 3.0.3
>>>
>>> I crreated a simple HelloCordova app:
>>>
>>>  cordova create HelloCordova com.notacompany.test HelloCordova
>>>
>>>> cd HelloCordova
>>>> codova platform add android
>>>> cd platforms\android  (Windows build)
>>>> cordova build android --debug
>>>>
>>>>
>>> I get immediate error:
>>>
>>>  [TypeError: Cannot read property 'parser' of undefined]
>>>
>>>>
>>>>>>
>>>>>  There is probably a simple reason, but I could use some help finding
>>> it.
>>>
>>>
>>
>

Re: reverted cordova version -- now build fails on HelloCordova

Posted by "dev at watch2web.com" <de...@watch2web.com>.
Unfortunately, I wanted to revert to 3.0.3 because the latest was causing me 
some other issues. I know I'll have to deal with them later, but for now I 
just need to be productive.

Cordova 3.0.3 was working fine for me yesterday morning. But after 
installing the latest and reverting, it is broken. I can do bug hunting 
myself, but I'm new to node.js, and I don't know the design of the CLI as 
well as you. Are there any spec docs I can work from that will help me 
understand what is going on?


----- Original Message ----- 
From: "Andrew Grieve" <ag...@chromium.org>
To: "dev" <de...@cordova.apache.org>
Sent: Thursday, 23 January, 2014 05:19
Subject: Re: reverted cordova version -- now build fails on HelloCordova


> Probably you hit a bug in 3.0.3. Try updating to the latest version of the
> tool and see if the bug is fixed.
>
>
> On Thu, Jan 23, 2014 at 1:24 AM, dev at watch2web.com 
> <de...@watch2web.com>wrote:
>
>> Following the docs, I did:
>>
>>  npm install -g cordova@3.0.3
>>>
>>
>> It seemed to work: cordova -v gives 3.0.3
>>
>> I crreated a simple HelloCordova app:
>>
>>  cordova create HelloCordova com.notacompany.test HelloCordova
>>> cd HelloCordova
>>> codova platform add android
>>> cd platforms\android  (Windows build)
>>> cordova build android --debug
>>>
>>
>> I get immediate error:
>>
>>  [TypeError: Cannot read property 'parser' of undefined]
>>>>>
>>>>
>> There is probably a simple reason, but I could use some help finding it.
>>
> 


Re: reverted cordova version -- now build fails on HelloCordova

Posted by Andrew Grieve <ag...@chromium.org>.
Probably you hit a bug in 3.0.3. Try updating to the latest version of the
tool and see if the bug is fixed.


On Thu, Jan 23, 2014 at 1:24 AM, dev at watch2web.com <de...@watch2web.com>wrote:

> Following the docs, I did:
>
>  npm install -g cordova@3.0.3
>>
>
> It seemed to work: cordova -v gives 3.0.3
>
> I crreated a simple HelloCordova app:
>
>  cordova create HelloCordova com.notacompany.test HelloCordova
>> cd HelloCordova
>> codova platform add android
>> cd platforms\android  (Windows build)
>> cordova build android --debug
>>
>
> I get immediate error:
>
>  [TypeError: Cannot read property 'parser' of undefined]
>>>>
>>>
> There is probably a simple reason, but I could use some help finding it.
>