问题
I post here because this is driving me crazy.
I'm trying to get phonegap to work so: I installed ADT bundle (eclipse+adt plugin + android SDK) -> by the way their really should update that phonegap getting started tutorial which is still telling you to install all of that separately but instead of android SDK it gives you a link to the ADT bundle...
Anyway I have set my environment variables, so i can type java, javac, android, ant or whatever everything is fine.
Now when i go to my cordova-android/bin folder with cmd (i'm on windows) and type 'create "d:/dev/android/phonegaptest" "phonegaptest" "phonegaptest"' it tells me 'project already exists'. While the target folder is just an empty folder.
if instead I type 'create "d:/dev/android/any folder name which doesnt exist yet" "phonegaptest" "phonegaptest"' it tells me 'cordova-android\bin\create.js 181,5 MS JScript runtime error path not found'
How can I get this to work ? Thanks a lot
回答1:
I was having same issue. Make sure that the folder in the do NOT exists already.
D:\phonegap-2.3.0\lib\android\bin>create D:\myprojects\ com.thinkcode Fone2 Microsoft (R) Windows Script Host Version 5.8 Copyright (C) Microsoft Corporation. All rights reserved.
Project already exists!
D:\phonegap-2.3.0\lib\android\bin>create D:\myprojects\Fone com.thinkcode Fone2 Microsoft (R) Windows Script Host Version 5.8 Copyright (C) Microsoft Corporation. All rights reserved.
Creating new android project... Copying template files... Copying js, jar & config.xml files... Copying cordova command tools... Updating AndroidManifest.xml and Main Activity...
D:\phonegap-2.3.0\lib\android\bin>
回答2:
Ok I got it
Apparently you HAVE TO put com.something for package name or the JS error will come. This may seem obvious for java developers but PhoneGap is used by a lot of web devs who doesn't know anything about packages. So it SHOULD be specified, thanks again to this poorly written doc. The error doesn't tell you anything about package name problem so it doesn't help either.
Another thing: if the folder already exist it will tell you 'project already exist' so just don't create the folder manually.
Hope this helps.
回答3:
Make sure that the project path doesn't contain spaces
回答4:
Can't upvote yet, but for me it was an issue with a space in the project path!
回答5:
In command promt: locate to phonegap folder
E:\phonegap.2.3.0\lib\android\bin>create E:\<name>hrms com.hrms hrms <enter>
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.
Creating new android project...
Copying template files...
Copying js, jar & config.xml files...
Copying cordova command tools...
Updating AndroidManifest.xml and Main Activity...
created successfully
If project already exist means change project name or package or project location <folder directory>
.
cd E:\hrms
cmd3>E:\hrms>dir
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.
Creating new android project...
Copying template files...
Copying js, jar & config.xml files...
Copying cordova command tools...
Updating AndroidManifest.xml and Main Activity...
来源:https://stackoverflow.com/questions/14586931/phonegap-cordova-android-project-already-exists-or-runtime-error