Updating cordova-android@ in Visual Studio 2015 RT

2019-07-13 05:46发布

When I create a default Cordova TypeScript project, the project default is set to cordova-android@4.0.2.

I am using the latest version 4.1.0 and would like to have Visual Studio 2015 use 4.1.0 version as default.

Can I set the version of cordova-android in Visual Studio?

I would prefer not to update the cordova-android for each project using a command prompt.

Instructions on how to upgrade Cordova Android 4.1.0 using command prompt: http://cordova.apache.org/announcements/2015/07/21/cordova-android-4.1.0.html

1条回答
对你真心纯属浪费
2楼-- · 2019-07-13 06:25

The short version of what is described in the docs here is as follows:

In Visual Studio, right click on config.xml and select “View Code” and add the following under the root element in config.xml

<engine name="android" spec="4.1.0" />

Next, for projects where you have already executed a build for the platform on your system, you’ll also need to remove the old version of the Cordova platform.

Open a command prompt and go to your Cordova project root (not the solution root) and type the following commands:

npm install -g cordova
cordova platform remove android

The next time you build you will now be on the updated version of the platform.

Note removing the platform is only required if you've built using the old platform version on your machine and is a one time thing if so.

查看更多
登录 后发表回答