-
Notifications
You must be signed in to change notification settings - Fork 340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugins are not restored from package.json but only from config.xml #508
Comments
package.json
but only from config.xml
@aidanas Can you please test with When I tested with nightly and it appears that plugins are being restored correctly. rm -rf package-lock.json node_modules platforms plugins
$ cordova prepare
Warning: using prerelease version 10.0.0-nightly.2020.6.24.7b8e8678 ([email protected])
Discovered platform "android". Adding it to the project
Using cordova-fetch for [email protected]
Adding android project...
Creating Cordova project for the Android platform:
Path: platforms/android
Package: com.test.foobar
Name: foobar
Activity: MainActivity
Android target: android-28
Subproject Path: CordovaLib
Subproject Path: app
Android project created with [email protected]
Discovered plugin "cordova-plugin-whitelist". Adding it to the project
Installing "cordova-plugin-whitelist" for android
Discovered plugin "cordova-plugin-geolocation". Adding it to the project
Installing "cordova-plugin-geolocation" for android
Installing "cordova-plugin-compat" for android
Plugin doesn't support this project's cordova-android version. cordova-android: 8.0.0, failed version requirement:
<6.3.0
Skipping 'cordova-plugin-compat' for android
$ cordova plugin ls
Warning: using prerelease version 10.0.0-nightly.2020.6.24.7b8e8678 ([email protected])
cordova-plugin-compat 1.2.0 "Compat"
cordova-plugin-geolocation 2.4.3 "Geolocation"
cordova-plugin-whitelist 1.3.4 "Whitelist" The issue you are reporting might exist in 9.x but not in the upcoming 10.x release which is being prepared. You can test with nightly by updating your global install: npm uninstall -g cordova
npm install -g cordova@nightly You might also be able to use In your Cordova project directory, you could try this: rm -rf package-lock.json node_modules platforms plugins
npx cordova@nightly prepare Please remember that nightly is not production ready as it has not been voted on for release. |
@erisu, thanks for the heads up! I get however
Any ETA on Cordova 10 release dates? |
I have a lot of these issues also. Remove the platform Android before your step 5 where you remove those 3 directories, and then add platform again. Cordova prepare doesn't fetch npm modules and plugins, just cordova platform add. In short, try this sequence
It should work on the latest version of cordova cli |
Bug Report
Problem
Plugins are not restored from
package.json
. They are only restored if listed inconfig.xml
but since Cordova 9 plugins are to be managed withpackage.json
.Steps to recreate:
cordova create testPluginRestore com.example.testpluginrestore TestPluginRestore
cordova platform add android
cordova plugin add cordova-plugin-geolocation
cordova plugin ls
Lists plugin OK. Also entry inpackage.json
is present.rm -rf platforms/ plugins/ node_modules/
cordova prepare android
cordova plugin ls
What is expected to happen?
What does actually happen?
Information
The same behaviour was tested with other plugins
cordova-plugin-camera
,cordova-plugin-firebase-dynamiclinks
, and others with the same outcome.Command or Code
Environment, Platform, Device
Version information
Checklist
The text was updated successfully, but these errors were encountered: