Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error: project directory could not be found - with PhoneGap

I want to use the PhoneGap Developer App for my project. I updated my PhoneGap version on my Mac to the newest version with the following command:

sudo npm install -g phonegap

Then I cded to my project folder (root folder) and entered the command phonegap serve, but everything I get is an [error] project directory could not be found. When I create a completely new project, than everything works fine, but why can't I use that Developer App with my current project?

like image 971
John Brunner Avatar asked Dec 14 '22 22:12

John Brunner


2 Answers

The phonegap commands create a hidden directory at the root of the app called /.cordova

You can move this directory into your existing app created with cordova to enable phonegap serve

mv /app-created-with-phone-gap/.cordova /app-create-with-cordova/

like image 141
bzmw Avatar answered Jan 28 '23 18:01

bzmw


If the project was created with cordova it will be easiest to create a new project with phonegap and then copy over the www and config.xml from the existing project. You will also have to add the plugins to this new project but still use cordova plugin add to do so.

like image 42
Dawson Loudon Avatar answered Jan 28 '23 17:01

Dawson Loudon