cordova-cli icon indicating copy to clipboard operation
cordova-cli copied to clipboard

Package.json is updated incorectly when adding platform?

Open HarelM opened this issue 5 years ago • 3 comments

Copied from https://github.com/apache/cordova/issues/252

Bug Report

When I use a clean installation of my project and run cordova platform add android my package.json file gets changed significantly, and incorrectly.

What is expected to happen?

package.json should be respected

What does actually happen?

package.json get overwritten. Also dependencies are getting the wrong version

Information

It might be because I have the packages registered in dependencies and not devDependencies, I don't know...

Command or Code

Project can be found here: https://github.com/IsraelHikingMap/Site/tree/master/IsraelHiking.Web

Environment, Platform, Device

Currently testing on Android

Version information

Cordova cli: 10.0 cordova-android: 9.0

This started happening after the upgrade to 10.0 and android 9.0.

Checklist

  • [x] I searched for existing GitHub issues
  • [x] I updated all Cordova tooling to most recent version
  • [x] I included all the necessary information above

HarelM avatar Oct 27 '20 12:10 HarelM

Even after moving everything to devDependencies the cordova-ios version I'm using which has a bug I fixed but was not released yet is not respected. See here: https://ci.appveyor.com/project/IsraelHikingHost/site/builds/35979455/job/746gx1cajxc9867v See the code here: https://github.com/IsraelHikingMap/Site/tree/d4fc90b962cdb38df408e5cb87ca62e7c0649387/IsraelHiking.Web

HarelM avatar Oct 27 '20 12:10 HarelM

I opened the above issue in cordova-fetch repo: https://github.com/apache/cordova-fetch/issues/92

Another issue I'm now facing is the following, which I'm not sure is a bug in the plugin or in cordova-cli, but it used to work in previous version, so I believe it deserves looking into:

When I add the following plugin: @mauron85/cordova-plugin-background-geolocation it is added success fully to package.json and to the project but it adds a configuration with the name of "cordova-plugin-background-geolocation" which is another plugin that exists and when the CI runs cordova platform add ios/android it gets the wrong plugin. Again, not sure where the bug is...

HarelM avatar Oct 27 '20 20:10 HarelM

Facing the same issue in Ionic. "cordova-android": "^10.0.0", gets replaced by "cordova-android": "9.1.0",

kuramsai avatar Dec 05 '21 20:12 kuramsai