cordova platform add android doesn't work

我只是一个虾纸丫 提交于 2019-12-12 06:51:26

问题


I'm trying to create my first App, but now I have this problem :

When adding a new platform by cordova platform add android It only shows Adding android project...

And it does nothing more. The folder platforms is empty and it did not create the folder android. Please help.

[UPDATE]

Add -d to command and get this

C:\hello>cordova platform add android -d  
No scripts found for hook "before_platform_add". 
No version supplied. 
Retrieving version from config.xml... 
Adding android project...

( Sorry for my english ! )


回答1:


  1. Path Confirmation

Can you try to go over your path and check if the paths are correct?

Especially since some are in (x86) and some are not.

Also, instead of C:\apache-ant try C:\apache-ant\bin.

Even though cordova is already installed, addnpm` in your path as well just to be sure.

Check in C:\Users\USERNAME\AppData\ because your commands might be inside this.

Add ANT_HOME - C:\apache-ant to your variables. It might make a difference.

  1. Confirm paths

java -version

javac -version

node -v

cordova -v

npm -v

android (if it pops up)

  1. Try to start over

cordova platform remove android --verbose

cordova platform add android --verbose

If still fails, remove and add cordova again.



来源:https://stackoverflow.com/questions/38111715/cordova-platform-add-android-doesnt-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!