6
votes

I have a new blank cordova project that I would like to install a plugin into,

http://plugreg.com/plugin/EddyVerbruggen/LaunchMyApp-PhoneGap-Plugin

I've tried the following,

  1. open up cmd
  2. browse to application folder, containing .sln file
  3. install cordova using npm
  4. run 'cordova plugin add https://github.com/EddyVerbruggen/LaunchMyApp-PhoneGap-Plugin.git'

I receive the following error,

'Current working directory is not a Cordova-based project.'

Any idea how I get this to work, assuming that I can that is?

3

3 Answers

5
votes

Visual Studio Tools for Apache Cordova CPT3.0 added feature to add custom plugin, now you can use config.xml to add plugin from Git.

You can get more detail to install Visual Studio Tools for Apache Cordova CPT3.0 here. CPT3.0 requires to uninstall CPT2.0 and install Visual Studio Update 4 before installing CPT3.0

enter image description here

0
votes

Could be that your solution only contains the www folder of a phonegap plugin. While the actual root folder of a real phonegap application is a level above the www folder and contains folders like platform and others. Make sure the execute the command on the folder on level above or it won't recognize it indeed!

0
votes

okay so what you do is as follows,

  1. create a 'plugins' folder in your project root
  2. download the plugin git repository
  3. unpack the git repository to the plugins folder created in 1, so your folder structure should look something like myproject\plugins\myplugin\plugin.xml
  4. edit the plugin.xml
  5. change any preference elements as follows,

so the following is change like so, preference to param

<preference name="URL_SCHEME" />
<param name="URL_SCHEME" value="myvdesiredvalue" />