Cordova platform add android DEFAULT

#1

Hi,
Is there a way to keep the default android version to install, because if I just do “cordova platform add android” it always defaults to 6.3.0, and I want 7.1.1 for example. I know I can just do “cordova platform add android@7.1.1” but I’m afraid in some x months when I have to do an update I forget this detail and mess things up.

I tried to put

  <engine name="android" spec="^7.1.1" />

in config.xml but it’s removed when I do a “cordova platform rm android”.

Thanks

#2

No, when you remove the platform you have to specify which one you want to add again.

#3

Ok, thank you Susan. But I wonder, why does it install an older version by default ?

#4

It installs the version that is pinned in the CLI you are using. As there hasn’t been a CLI release for some time, it doesn’t use the most recent one. It’s just how Cordova works :confused:

#5

Understood, thank you for the information :slight_smile:

1 Like