When I run the command, I get the error:
C:\\Users\\me\\adtworkspace\\project1>cordova platform add android [Error: The provided path \"C:\\Users\\me\
If you were to do a "cordova -d platform add android", you'll probably see that it is because a prior error happened due to "There is no script engine for file extension ".js"".
Windows associated .js files with some other editors, so you have to disassociate this by typing:
assoc .js=JSFILE
After doing this, just run the add platform ("cordova platform add android") command again and it should work fine.
Delete C:/users/yourusername/.cordova and run command again, files are propably corrupted, it fixed this issue for me
Yes it's indeed a Cordova Metadata issue. So Krystofs' answer is correct. Where: The "right thing" to do is, to give a
# cordova platform rm <platform>
command :) Then - afterwards - another adding of the plaform shall sort the issue
This is happening when you missing some files in your android platform folder in your cordova project.
Same thing can happen with the windows projects as well.
Visual Studio or Cordova engine has the capability of creating platform directories even if you delete them. But in this case the folder was there and it had some files in it. So the best solutions for this issue is trying one of these steps.
Clean your project. ( Visual Studio ) Rebuild your project ( Visual Studio ) Delete platform directory that you have the issue and build the project.
I had the same problem which I solved using the -d flag to show debug output
cordova -d platform add android
My debug output showed that I need to set a JAVA_HOME environment variable and then I needed to add JAVA and ANT to the path.
I have faced the same but building for iOS.
I had an old build within the platforms
folder. Try deleting it, then build again:
phonegap build [ios/android]
Hope this helps!