Skip to content
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

Failed to fetch platform cordova-android@^9.0.0 Probably this is either a connection problem, or platform spec is incorrect. #1133

Closed
3 tasks done
Vulisha opened this issue Nov 27, 2020 · 2 comments

Comments

@Vulisha
Copy link

Vulisha commented Nov 27, 2020

Bug Report

Hi,
I opened this ticket as support previously as support ticked do not have template, this one does, and it was required from me to open it using template so I opened it as a bug.

Problem

Adding platform on cordova stopped working for some reason, tried to update nodeJs and it did not help:

cordova platform add android
Using cordova-fetch for cordova-android@^9.0.0
Failed to fetch platform cordova-android@^9.0.0
Probably this is either a connection problem, or platform spec is incorrect.
Check your connection and platform name/version/URL.
CordovaError: TypeError: Cannot assign to read only property 'valueOf' of object '[object Object]'

What is expected to happen?

Android platform added.

What does actually happen?

Failed to fetch platform.

Information

cordova platform list
Installed platforms:

Available platforms:
  android ^9.0.0
  browser ^6.0.0
  electron ^1.0.0
  windows ^7.0.0

Tried with nodejs 12 and 14.
Tried npm cache clean --force
Tried deleting whole solution and reverting from git
Tried npm uninstall -g cordova then install again
Also tried deleting whole solution and pulling it again from git as solution works on different device.

If you need any more information please leave a comment and I will provide.

Command or Code

Literary just:
cordova platform add android

Environment, Platform, Device

Windows 10 Laptop
NodeJs 12.20.0
[email protected]

Version information

cordova 10.0.0 and dependancies (cordova-android is 9.0.0)
Windows 10
Android Studio 3.5, all needed SDKs installed
Ionic not used, only ionic wkwebview plugin
npm outdated:

Package                                 Current  Wanted  Latest 
cordova-plugin-androidx-adapter           1.1.1   1.1.3   1.1.3 
cordova-plugin-crypto-file                1.4.0     git     git 
cordova-plugin-firebase-analytics         4.5.0   4.5.0   5.0.0 
cordova-plugin-iroot                      2.1.0     git     git 
cordova-plugin-sslcertificatechecker      5.1.0     git     git 
cordova-plugin-statusbar              3.0.0-dev     git     git 
cpy                                       7.3.0   7.3.0   8.1.1 
cpy-cli                                   2.0.0   2.0.0   3.1.1 
dom7                                      2.1.3   2.1.5   3.0.0 
eslint                                    6.8.0   6.8.0  7.14.0 
eslint-plugin-html                        6.0.0   6.1.1   6.1.1 
framework7                                4.5.2   4.5.2  5.7.14 
framework7-icons                          2.3.1   2.3.1   3.0.1 
http-server                              0.11.1  0.11.1  0.12.3 

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@breautek
Copy link
Contributor

breautek commented Nov 27, 2020

Reinstall cordova. If you're using a global install, this should suffice:

npm uninstall -g cordova
npm install -g cordova

If you're using a locally installed cordova, ensure you delete your package-lock.json file and remove your node_modules folder.

See apache/cordova-cli#543 for why this happened.

@Vulisha
Copy link
Author

Vulisha commented Nov 27, 2020

Indeed this was the fix. Issue opened on same day as mine first ticket, and other project(cordova vs cordova-cli), so I did not see solution. Thank you very much on a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants