Bug 236967 - Unable to build Cordova projects with Cordova 3.1.0
Unable to build Cordova projects with Cordova 3.1.0
Status: RESOLVED WONTFIX
Product: web
Classification: Unclassified
Component: Cordova
7.4
PC Linux
: P3 (vote)
: TBD
Assigned To: Jan Becicka
issues@web
: RELNOTE
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-09 21:01 UTC by Marcoevich
Modified: 2014-01-20 09:09 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcoevich 2013-10-09 21:01:40 UTC
I cannot build any other projects besides the CordovaMapsSample project delivered with Netbeans 7.4 RC2.

This happens because Netbeans deletes the org.apache.cordova.file plugin which is needed to build the projects.

The very same projects build fine when using the cli.

Also, when I manually add the plugin using 'cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-file.git' then Netbeans still removes the plugin during build process.

Here are the log entries:

'org.apache.cordova.file' ]

Writing out cordova_plugins.js...

Removing plugin org.apache.cordova.media-capture...

Dependencies detected, iterating through them and removing them first...

Removing plugin org.apache.cordova.file...

org.apache.cordova.media-capture removed.

cordova.cmd -d plugin remove org.apache.cordova.file

Error: Plugin "org.apache.cordova.file" not added to project.

    at C:\Users\RICKGO~1\AppData\Roaming\npm\node_modules\cordova\src\plugin.js:205:39

    at Array.forEach (native)

    at C:\Users\RICKGO~1\AppData\Roaming\npm\node_modules\cordova\src\plugin.js:179:34

    at C:\Users\RICKGO~1\AppData\Roaming\npm\node_modules\cordova\src\hooker.js:67:25

    at execute_scripts_serially (C:\Users\RICKGO~1\AppData\Roaming\npm\node_modules\cordova\src\hooker.js:94:9)

    at C:\Users\RICKGO~1\AppData\Roaming\npm\node_modules\cordova\src\hooker.js:63:17

    at execute_handlers_serially (C:\Users\RICKGO~1\AppData\Roaming\npm\node_modules\cordova\src\hooker.js:110:9)

    at Object.fire (C:\Users\RICKGO~1\AppData\Roaming\npm\node_modules\cordova\src\hooker.js:55:9)

    at CLI.plugin (C:\Users\RICKGO~1\AppData\Roaming\npm\node_modules\cordova\src\plugin.js:174:19)

    at new CLI (C:\Users\RICKGO~1\AppData\Roaming\npm\node_modules\cordova\src\cli.js:95:26)

Result: 1

cordova.cmd -d plugin remove org.apache.cordova.device-motion

Calling plugman.uninstall on plugin "org.apache.cordova.device-motion" for platform "android"

Error: ENOENT, no such file or directory 'C:\NetbeansProjects\CordovaTestProject\plugins\org.apache.cordova.file\plugin.xml'
Comment 1 Marcoevich 2013-10-09 21:06:15 UTC
Product Version: NetBeans IDE 7.4 RC2 (Build 201309252201)
Java: 1.7.0_40; Java HotSpot(TM) 64-Bit Server VM 24.0-b56
Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b43
System: Windows 7 version 6.1 running on amd64; Cp1252; nl_NL (nb)
Comment 2 Vladimir Riha 2013-10-10 06:00:08 UTC
Could you please try recent dev build from [1]? It's possible it has been fixed already. Cordova changed plugin names (removed "core"), see issue 236652 for more details. Thank you

[1] http://bits.netbeans.org/netbeans/trunk/nightly/latest/
Comment 3 Marcoevich 2013-10-10 09:14:00 UTC
It's not fixed yet, the android build still fails:

Product Version: NetBeans IDE Dev (Build 201310070001)
Java: 1.7.0_40; Java HotSpot(TM) 64-Bit Server VM 24.0-b56
Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b43
System: Windows 7 version 6.1 running on amd64; Cp1252; nl_NL (nb)

Here are the log entries:

cordova.cmd -d plugin remove org.apache.cordova.file
Calling plugman.uninstall on plugin "org.apache.cordova.file" for platform "android"
Error: Another top-level plugin (org.apache.cordova.file-transfer) relies on plugin org.apache.cordova.file, therefore aborting uninstallation.
    at C:\Users\RICKGO~1\AppData\Roaming\npm\node_modules\cordova\node_modules\plugman\src\uninstall.js:93:27
    at Array.forEach (native)
    at runUninstall (C:\Users\RICKGO~1\AppData\Roaming\npm\node_modules\cordova\node_modules\plugman\src\uninstall.js:89:10)
    at Function.module.exports.uninstallPlatform (C:\Users\RICKGO~1\AppData\Roaming\npm\node_modules\cordova\node_modules\plugman\src\uninstall.js:42:5)
    at C:\Users\RICKGO~1\AppData\Roaming\npm\node_modules\cordova\src\plugin.js:201:51
    at Array.forEach (native)
    at C:\Users\RICKGO~1\AppData\Roaming\npm\node_modules\cordova\src\plugin.js:196:42
    at Array.forEach (native)
    at C:\Users\RICKGO~1\AppData\Roaming\npm\node_modules\cordova\src\plugin.js:179:34
    at C:\Users\RICKGO~1\AppData\Roaming\npm\node_modules\cordova\src\hooker.js:67:25
Result: 1

cordova.cmd -d run android
cordova library for "android" already exists. No need to download. Continuing.
Error: ENOENT, no such file or directory 'C:\NetbeansProjects\OTSpellingsChecker\plugins\org.apache.cordova.file'
    at Object.fs.statSync (fs.js:684:18)
    at C:\Users\RICKGO~1\AppData\Roaming\npm\node_modules\cordova\node_modules\plugman\src\prepare.js:124:15
    at Array.forEach (native)
    at Object.handlePrepare (C:\Users\RICKGO~1\AppData\Roaming\npm\node_modules\cordova\node_modules\plugman\src\prepare.js:122:24)
    at C:\Users\RICKGO~1\AppData\Roaming\npm\node_modules\cordova\src\prepare.js:92:37
    at Object.module.exports.update_project (C:\Users\RICKGO~1\AppData\Roaming\npm\node_modules\cordova\src\metadata\android_parser.js:218:23)
    at C:\Users\RICKGO~1\AppData\Roaming\npm\node_modules\cordova\src\prepare.js:88:32
    at C:\Users\RICKGO~1\AppData\Roaming\npm\node_modules\cordova\src\lazy_load.js:48:31
    at Object.module.exports.custom (C:\Users\RICKGO~1\AppData\Roaming\npm\node_modules\cordova\src\lazy_load.js:57:34)
    at Object.lazy_load [as cordova] (C:\Users\RICKGO~1\AppData\Roaming\npm\node_modules\cordova\src\lazy_load.js:43:24)
C:\NetbeansProjects\OTSpellingsChecker\nbproject\build.xml:262: exec returned: 1
BUILD FAILED (total time: 2 minutes 7 seconds)
Comment 4 Marcoevich 2013-10-10 09:17:08 UTC
After the first report in comment above, Netbeans detects that file-transfer plugin has the file plugin as dependancy and cannot be uninstalled. So Netbeans will uninstall both of them...

Iterating over installed plugins: [ 'org.apache.cordova.console',
  'org.apache.cordova.dialogs',
  'org.apache.cordova.device-orientation',
  'org.apache.cordova.battery-status',
  'org.apache.cordova.vibration',
  'org.apache.cordova.device',
  'org.apache.cordova.media-capture',
  'org.apache.cordova.splashscreen',
  'org.apache.cordova.camera',
  'org.apache.cordova.file' ]
Writing out cordova_plugins.js...
Removing plugin org.apache.cordova.file-transfer...
Dependencies detected, iterating through them and removing them first...
Removing plugin org.apache.cordova.file...
org.apache.cordova.file-transfer removed.
cordova.cmd -d plugin remove org.apache.cordova.dialogs
Calling plugman.uninstall on plugin "org.apache.cordova.dialogs" for platform "android"
Error: ENOENT, no such file or directory 'C:\NetbeansProjects\OTSpellingsChecker\plugins\org.apache.cordova.file\plugin.xml'
Comment 5 Vladimir Riha 2013-10-10 09:26:37 UTC
Could you please describe step by step how to reproduce it and if you created the project in the dev build or 7.4 RC2? I've faced similar issue with Cordova CLI [1] but I'm not sure if it's the same.  


[1] https://issues.apache.org/jira/browse/CB-4992
Comment 6 Marcoevich 2013-10-10 09:35:40 UTC
I created the project in Netbeans 7.4 RC2, then opened the same project in the devbuild you suggested. I only choose to run the project on android device, and then let Netbeans do it's work. I've tried this over 10 times with different projects in the RC2 build and now one time in the dev build. The result is always the same.

On the CLI I just have to do 'phonegap build android' and then 'cordova run android' and the app will be pushed to the device without any error.
Comment 7 Vladimir Riha 2013-10-10 11:21:23 UTC
Thank you. I think this is a consequence of renaming plugins in Cordova (see issue 236652). If you create project in the dev build and repeat your steps (but all in dev build, not using RC2 at all), it should work. 

The fix for 236652 will be part of final NetBeans 7.4 so if you create project in final 7.4 (once released), it will work. I think this happens only with some plugins that have dependencies. If you try following:
- create project in RC2, remove all plugins using project properties but leave Battery status
- build project
- open the project in Dev build
- build again
=> build finishes OK, but plugin has been removed as in RC2 it had different name and if you now open Project Properties of the project in Dev build, you can see that it shows that project has no plugins and you have to add the Battery status again
- build again
=> build finishes OK including the plugin
Comment 8 Marcoevich 2013-10-10 13:52:18 UTC
I am not able to reproduce your steps.

When I delete all plugins but battery status Netbeans tries to uninstall them when I build the project. This immediately results in failures on all calls to uninstall:

cordova.cmd -d plugin remove org.apache.cordova.device
Calling plugman.uninstall on plugin "org.apache.cordova.device" for platform "android"
Error: ENOENT, no such file or directory 'C:\NetbeansProjects\OTSpellingsChecker\plugins\org.apache.cordova.file\plugin.xml'
    at Object.fs.openSync (fs.js:427:18)
    at Object.fs.readFileSync (fs.js:284:15)
    at Object.module.exports.parseElementtreeSync (C:\Users\RICKGO~1\AppData\Roaming\npm\node_modules\cordova\node_modules\plugman\src\util\xml-helpers.js:119:27)
    at C:\Users\RICKGO~1\AppData\Roaming\npm\node_modules\cordova\node_modules\plugman\src\util\dependencies.js:21:35
    at Array.forEach (native)
    at Object.module.exports.generate_dependency_info (C:\Users\RICKGO~1\AppData\Roaming\npm\node_modules\cordova\node_modules\plugman\src\util\dependencies.js:20:45)
    at runUninstall (C:\Users\RICKGO~1\AppData\Roaming\npm\node_modules\cordova\node_modules\plugman\src\uninstall.js:83:40)
    at Function.module.exports.uninstallPlatform (C:\Users\RICKGO~1\AppData\Roaming\npm\node_modules\cordova\node_modules\plugman\src\uninstall.js:42:5)
    at C:\Users\RICKGO~1\AppData\Roaming\npm\node_modules\cordova\src\plugin.js:201:51
    at Array.forEach (native)
Result: 1

This happens both in RC4 and in dev build
Comment 9 Vladimir Riha 2013-10-10 14:30:05 UTC
Weird, so if you do this in Dev build:
- create new cordova project in IDE
- build it (from IDE)

Then it fails for you? I've tried it, built project several times and it worked for me. 

How did you make 7.4 RC2 to work with cordova 3.1.0 (I had to manually edit Cordova script before invoking new project dialog)? Is it possible that you've changed something wrong by accident?


Product Version: NetBeans IDE Dev (Build 201310100001)
Java: 1.7.0_45; Java HotSpot(TM) Client VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b13
System: Linux version 3.2.0-48-generic-pae running on i386; UTF-8; en_US (nb)
Comment 10 Marcoevich 2013-10-10 15:40:44 UTC
Hmm no, previously I used my project that was created in 74 RC2, but now I create a total new project and it seems to work :)

In 7.4 RC2, I edited the file cordova.cmd to '@ echo 3.0.1' so it would return a version number Netbeans would recognize. Then after creating the project I edit it back to what it used to be in order for cordova to work correctly.

So this means that our issue has been resolved :)

Unfortunately I cannot build (with the devbuild) projects created in 7.4 RC2 right now. Will I be able to do this when the next patch for 7.4 comes out? Or would it be advisable to create total new projects in the dev build?
Comment 11 Vladimir Riha 2013-10-11 05:58:29 UTC
What seemed to worked for me is to:
 - edit [projectFolder]/nbproject/plugins.properties and remove "core" from plugin name, e.g.

from
org.apache.cordova.core.camera=https://git-wip-us.apache.org/repos/asf/cordova-plugin-camera.git

to

org.apache.cordova.camera=https://git-wip-us.apache.org/repos/asf/cordova-plugin-camera.git

 - delete everything in [projectFolder]/platforms
 - delete everything in [projectFolder]/plugins

And build project again
Comment 12 Marcoevich 2013-10-11 10:25:35 UTC
That works like a charm! :)

Thx a lot Vladimir!
Comment 13 Marian Mirilovic 2013-10-11 10:36:19 UTC
For release notes ... see Comment 11
Comment 14 Jan Becicka 2013-10-24 11:52:35 UTC
This happens only when using projects from dev (beta RC) builds. Does not happen with fresh projects from FCS. We does not guarantee compatibility between dev and FCS builds.
Comment 15 snikolaidis 2014-01-18 00:37:07 UTC
Nope. It doesn't work.

I have Ubuntu 13.10 and I'm trying on 7.4, 8.0 and the latest night built, I'm doing the same steps:

1. Create new cordova project
2. Run on the emulator

I always get the same error:

Error: ENOENT, no such file or directory 'org.apache.cordova.file/plugin.xml'
    at Object.fs.openSync (fs.js:427:18)
    at Object.fs.readFileSync (fs.js:284:15)
    at Object.module.exports.parseElementtreeSync (/usr/lib/node_modules/cordova/node_modules/plugman/src/util/xml-helpers.js:119:27)
    at movePlugin (/usr/lib/node_modules/cordova/node_modules/plugman/src/fetch.js:75:35)
    at Object.fetchPlugin (/usr/lib/node_modules/cordova/node_modules/plugman/src/fetch.js:114:11)
    at possiblyFetch (/usr/lib/node_modules/cordova/node_modules/plugman/src/install.js:52:31)
    at /usr/lib/node_modules/cordova/node_modules/plugman/src/install.js:301:17
    at Array.forEach (native)
    at runInstall (/usr/lib/node_modules/cordova/node_modules/plugman/src/install.js:227:22)
    at possiblyFetch (/usr/lib/node_modules/cordova/node_modules/plugman/src/install.js:62:9)
/home/stratos/NetBeansProjects/mytest/nbproject/build.xml:227: exec returned: 1
BUILD FAILED (total time: 1 minute 32 seconds)


I don't know if it helps, but on the new project wizard, I cannot download jquery-mobile library. Other libraries are downloaded normally, jquery, iscroll etc; but jquery-mobile? nope.
Comment 16 snikolaidis 2014-01-18 00:40:00 UTC
I forgot to mention the night build version:

NetBeans IDE Build 201401170001


Also, in the [projectFolder]/nbproject/plugins.properties file, there is no 'core' by default in all versions.
Comment 17 Jan Becicka 2014-01-20 08:48:53 UTC
snikolaidis, your error comes from cordova. Not from NetBeans...
Comment 18 Marcoevich 2014-01-20 09:09:00 UTC
Snikolaidis, what Cordova version are you using?

Type 'cordova -v' in the commandline to check what version you have.

For me latest Cordova 3.3.1 branch is giving me trouble as well, but 3.1.0-0.2.0 works perfectly fine for me, also in coöperation with Netbeans.

What you can try is doing a 'npm uninstall -g cordova' on the commandline. This will uninstall your currenct Cordova build.

Then do 'npm install -g cordova@3.1.0-0.2.0' which will install that specific cordova version for you.

Let me know if it works for you ;)


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo