Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cordova platform add android gives the error: "Error: The provided path is not an Android project."

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\adtworkspace\project1\platforms\android" is not an Android project.]

What am I doing wrong?

like image 400
user2320724 Avatar asked Jul 05 '13 00:07

user2320724


3 Answers

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

like image 60
Juergen Klasen Avatar answered Oct 20 '22 05:10

Juergen Klasen


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.

like image 39
Nick Holcombe Avatar answered Oct 20 '22 05:10

Nick Holcombe


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.

like image 37
user2621227 Avatar answered Oct 20 '22 05:10

user2621227