StarQuake
StarQuake

Reputation: 147

How do I upgrade to the next cordova version?

My project was built when Cordova 3.5.0 was out. Cordova 3.6.0 is out now.

How do I upgrade Cordova in my project?

I already did "npm -g update cordova" but that does not seem to be the version CTP uses.

Upvotes: 2

Views: 2673

Answers (5)

Niels Steenbeek
Niels Steenbeek

Reputation: 4834

I cried a lot while developing Cordova in VS. First I removed the 'bin', 'bld' and 'platforms' folders and restarted VS after every plugin/cordova change. Later-on I found it's easier to clear the cache. This will also do the job for Cordova version upgrade:

1) In VisualStudio project doubleclick config.xml
2) Click 'Platforms' and select Cordova CLI
3) Click 'tools' => 'Options'
4) Expand 'Tools for Apache Cordova' and click 'Cordova Tools'
5) 'Clear Cordova Cache' and click 'ok'
6) Rebuild the application

Upvotes: 0

For CTP 2.0 you can edit the file platforms.js in %APPDATA%\Roaming\npm\node_modules\vs-mda\node_modules\cordova\node_modules\cord‌​ova-lib\src\cordova\platforms.js and update the versions of Cordova that should be used for each platform. You should check the github URLS listed in the file to see what versions are available and update the 'version:' elements as needed.

Using this method I changed the android section of platforms.js from :

'android' : {
    parser : './metadata/android_parser',
    url    : 'https://git-wip-us.apache.org/repos/asf?p=cordova-android.git',
    version: '3.5.0'
},

to:

'android' : {
    parser : './metadata/android_parser',
    url    : 'https://git-wip-us.apache.org/repos/asf?p=cordova-android.git',
    version: '3.5.1'
},

After editing delete the contents of the bld directory belonging to your project. Start VS, load your project and perform a clean and then a build. You can check the build output and verify that it downloads the new version of Cordova to use during the build process.

Upvotes: 2

rd_rscan
rd_rscan

Reputation: 302

I received a warning from Google Play because the Cordova Version of my application:

"You should upgrade to Apache Cordova 3.5.1 or higher as soon as possible. For more information about the vulnerabilities, and for guidance on upgrading Apache Cordova, please see http://cordova.apache.org/announcements/2014/08/04/android-351.html."

So, I also need a way to update cordova version in "Multi-Device Hybrid Apps for Visual Studio". I submited it in connect: https://connect.microsoft.com/VisualStudio/feedback/details/991242

Upvotes: 0

Ponmalar
Ponmalar

Reputation: 7031

Multi-Device Hybrid Apps for Visual Studio CTP2.0 will use the source of 'Cordova version 3.5.0'. Even updating Command Line Interface using the command, that you mentioned, will not affect the Multi-Device Source. Only downloading the Source using command (Command Line Interface) will get the latest version of Cordova.

Create New project using Command Line Interface to get latest version of Cordova (3.6.0): https://cordova.apache.org/docs/en/3.0.0/guide_cli_index.md.html

Upvotes: 1

Avani
Avani

Reputation: 566

CTP 2.0 of the MDHA apps only targets Cordova 3.5.0. Currently, there is no way to retarget your project to 3.6.0.

Upvotes: 4

Related Questions