cordova - Error: Failed to fetch platform android

后端 未结 15 2372
情深已故
情深已故 2020-11-29 09:19

I installed cordova and create a new project.

But when I use this command to add android platform:

cordova platform add android

相关标签:
15条回答
  • 2020-11-29 10:10

    I resolved this error using following steps 1) Please add C:\Windows\System32 in envrionment variable paths 2) ensure JDK/bin path is setup under JAVA_HOME and path 3) ensure sdk path is setup under ANDROID_HOME and path I found this solution from here https://dipoletechi.com/blog-post/cordovaerror-failed-to-fetch-platform-cordova-android8-0-0-cordova-error-failed-to-fetch-platform-android/

    0 讨论(0)
  • 2020-11-29 10:11

    I had the same problem with the android@5.1.1 version. I solved this issue, checking what version of android is provided by cordova. You can check it in C:/Users/%USER%/.cordova/lib/npm-cache/cordova-android

    Then, you install the android platform version provided. For me it was @5.1.0 which was in my cordova-android folder. So I used the cmd line following:

    cordova platform add android@5.1.0 which should be a differnet version for you.

    Kind regards !

    0 讨论(0)
  • 2020-11-29 10:11

    In my case after so many attempts, I solved the issue by running this command:

    sudo npm install npm@4.6.1 -g 
    

    Then I was able to add platform and build my project.

    0 讨论(0)
提交回复
热议问题