4

When I move my PhoneGap project to another folder, I can't run phonegap local commands anymore. For example, this command:

phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-console.git

results in this error:

[error] project directory could not be found

My guess is that PhoneGap defines project directory somewhere in configuration and it can't find my project because I moved it to another folder. I there a way to change PhoneGap project directory in configuration?

Nikolai Samteladze
  • 7,699
  • 6
  • 44
  • 70

5 Answers5

8

The CLI tool create a new folder called ".cordova" for every project which is mostly hidden in some systems.

This folder is required for the folder to be identified as a phonegap project.

Purus
  • 5,701
  • 9
  • 50
  • 89
3

The .cordova folder has a simple config.json file (did on mine), so you can copy it around with no trouble.

pojda
  • 193
  • 9
1

Ok, here is how PhoneGap defines the project directory:

  • Has a .cordova directory, with a config.json inside.
  • Has a www directory, with a config.xml inside.
  • Has a platforms directory.

I found that with that in place you can use PhoneGap without issues. If you need an example for that config files just run phonegap create myapp.

Jesús Carrera
  • 11,275
  • 4
  • 63
  • 55
1

To complete other answers, this thread will help you understand what should be put in version control or not. The .cordova file should rather be versionned to avoid this kind of problems.

What parts of cordova cli generated projects can be safely versioned in source control?

Community
  • 1
  • 1
Sebastien Lorber
  • 89,644
  • 67
  • 288
  • 419
0

you can use plugman npm install -g plugman

after it fot add plugin: plugman install --platform ios --project /YOUR/PROJECT/PATH/PATH/platforms/ios --plugin /YOUR/PLUGIN/DIR/plugin1