问题
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:
- 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, add
npm` 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.
- Confirm paths
java -version
javac -version
node -v
cordova -v
npm -v
android
(if it pops up)
- 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