Open ebhsgit opened 4 years ago
@ebhsgit were you able to find a work around for this? I have the same issue with cordova-ios git version...
I think I was able to overcome this by placing the cordova-ios git link in dependencies
and not devDependencies
. I'm failing to understand the logic here if it's not a bug...
Same here, don't put cordova-android and cordova-ios in devDependencies, or they will not be taken into account.µ When running cordova build, cordova fetches another version from npm, silently.
Definintely a bug according to https://github.com/apache/cordova-fetch/pull/65 mentioning "platforms and plugins"
@erisu this is the bug we talked about in slack...
Yeah, I remember, except I can not reproduce this at all.
I showed you all the steps I took to try to reproduce it and its output but everything checked out correctly.
@erisu I'm having this issue again (this time with a regular version and not git repo version).
See if you can reproduce it on your end:
Clone https://github.com/IsraelHikingMap/Site
cd IsraelHiking.Web
npm install
rm -rf platforms/ && rm -rf plugins/ (just in case...)
npx cordova platform remove android
npx cordova platform add android@10.1.1
npx cordova prepare android
this will output the following: Using cordova-fetch for cordova-android@^9.0.0.
If I move the "cordova-android": "^10.1.1"
in my package.json from devDependencies
to dependencies
prepare
command will work with the right version.
I think this will be resolved by https://github.com/apache/cordova-lib/pull/880 which was just merged in. In a day or two, you can test it by installing cordova@nightly
.
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 andcordova
to 10.0.0, when I build I notice that some of my cordova plugins where moved todevDependencies
.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 apache/cordova-fetch#64, which is released in
cordova-fetch
3.0.0So I decided to manually move all the other cordova plugins and cordova-android platform to
devDependencies
.If I leave
cordova-android
independencies
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
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 Packages:
Project Installed Platforms:
Environment:
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