Bug Report
cordova-android referencing git repo is not respected, and is being changed to npm package version when performing a release build
Problem
When cordova-android is in devDependencies, and is referencing a git branch (rather than a npm package version).
As part of the release build (with clean environment - no platform and plugin folder), cordova-android reference is changed to latest stable npm package.
example package.json
"devDependencies": {
....
"cordova-android": "git+https://github.com/8bhsolutions/cordova-android.git#9.0.x-mod",
.....
}
What is expected to happen?
The reference should remains unchanged.
What does actually happen?
The reference gets changed to 9.0.0, and the build process
"devDependencies": {
....
"cordova-android": "9.0.0",
.....
}
Information
After upgrading cordova-android
to 9.0 and cordova
to 10.0.0, when I build I notice that some of my cordova plugins where moved to devDependencies
.
It seems that only the cordova plugins which reference git repos were moved. The plugins that reference a npm package release were still kept in dependencies
node.
Then googling for why this happened, I stumbled across the #64, which is released in cordova-fetch
3.0.0
So I decided to manually move all the other cordova plugins and cordova-android platform to devDependencies
.
If I leave cordova-android
in dependencies
node, the build does not touch it.
Command or Code
When I checkout a clean copy of my source code. So the node_module, platform and plugins folder will be fetched as part of the build process.
I run then following command
- npm install
- ionic cordova build android --release
Environment, Platform, Device
Windows 10
VS Code: 1.50.1
Node: 12.19.0
Release build for Android
Debug build seems ok
Version information
cordova info
Cordova Packages:
cli: 10.0.0
common: 4.0.2
create: 3.0.0
lib: 10.0.0
common: 4.0.2
fetch: 3.0.0
serve: 4.0.0
Project Installed Platforms:
Environment:
OS: Microsoft Windows 10 Pro 10.0.19041 (19041) (win32 10.0.19041) x64
Node: v12.19.0
npm: 6.14.8
ionic info
Ionic:
Ionic CLI : 5.2.3
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.4
Cordova:
Cordova CLI : 10.0.0
Cordova Platforms : android 9.0.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 3.1.2, (and 42 other plugins)
Utility:
cordova-res : not installed
native-run : 0.2.8
System:
Android SDK Tools : 26.1.1
NodeJS : v12.19.0
npm : 6.14.8
OS : Windows 10
Checklist