Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Phonegap cordova android 'project already exists' or runtime error

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

like image 560
Rayjax Avatar asked Jan 29 '13 15:01

Rayjax


2 Answers

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>

like image 70
Yugandhar Avatar answered Sep 18 '22 02:09

Yugandhar


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.

like image 26
Rayjax Avatar answered Sep 18 '22 02:09

Rayjax