0

I followed this tutorial: http://cordova.apache.org/docs/en/5.0.0/guide_hybrid_plugins_index.md.html#Plugin%20Development%20Guide

now my plugin looks like this:

[echo_plugin]
[src]
  [org]
    [apache]
      [cordova]
        [plugin]
          -Echo.java
[www]
  -foo.js
plugin.xml

then I made a fresh project and added android platform

phonegap creata plgn
cd plgn
phonegap platform add android

now I want to add my echo plugin to my project:

c:\phonegap\plgn>plugman install --platform android --project c:\phonegap\plgn\ --plugin c:\phonegap\echo_plugin

but I get:

Installing "com.alunny.foo" for android cordova version check failed ("c:\phonegap\plgn\cordova\version"), continuing anyways. Failed to install 'com.alunny.foo':CordovaError: The provided path "c:\phonegap\plgn" is not an Andr oid project. at new android_parser (C:\Users\A\AppData\Roaming\npm\node_modules\plugman\node_modules\cordova- lib\src\cordova\metadata\android_parser.js:35:15) at new PlatformProjectAdapter (C:\Users\A\AppData\Roaming\npm\node_modules\plugman\node_modules\ cordova-lib\src\platforms\platforms.js:61:19) at Object.getPlatformProject (C:\Users\A\AppData\Roaming\npm\node_modules\plugman\node_modules\c ordova-lib\src\platforms\platforms.js:97:23) at handleInstall (C:\Users\A\AppData\Roaming\npm\node_modules\plugman\node_modules\cordova-lib\s rc\plugman\install.js:537:36) at C:\Users\A\AppData\Roaming\npm\node_modules\plugman\node_modules\cordova-lib\src\plugman\inst all.js:342:28 at _fulfilled (C:\Users\A\AppData\Roaming\npm\node_modules\plugman\node_modules\q\q.js:787:54) at self.promiseDispatch.done (C:\Users\A\AppData\Roaming\npm\node_modules\plugman\node_modules\q \q.js:816:30) at Promise.promise.promiseDispatch (C:\Users\A\AppData\Roaming\npm\node_modules\plugman\node_mod ules\q\q.js:749:13) at C:\Users\A\AppData\Roaming\npm\node_modules\plugman\node_modules\q\q.js:509:49 at flush (C:\Users\A\AppData\Roaming\npm\node_modules\plugman\node_modules\q\q.js:108:17) The provided path "c:\phonegap\plgn" is not an Android project.

user1930254
  • 1,251
  • 5
  • 17
  • 32
  • why don't you try to install it with the phonegap CLI instead of using plugman? – jcesarmobile Jul 15 '15 at 16:34
  • @jcesarmobile I did as you suggested, and it is installed, but the plugin does not work. I copied all the files of https://github.com/apache/cordova-mobile-spec/tree/master/cordova-plugin-echo to a folder. I made a fresh project, added android platform, then "phonegap plugin add c:\phonegap\echo_plugin". Install went smooth, I can see the plugin if I do "phonegap plagin ls". I use Phonegap Developer App and jsconsole.com to debug. App runs, but I cant access "window.cordova.echo" or "cordova.echo". They are undefined. Could someone confirm this? – user1930254 Jul 15 '15 at 19:56
  • You can't use your own plugins (or any 3rd party plugin) on the phonegap developer app – jcesarmobile Jul 15 '15 at 20:47
  • @jcesarmobile yes, have just fond out. thank you. wht is your workflow? "phonegap build" then copy tha apk to the device? – user1930254 Jul 15 '15 at 22:17
  • When I'm creating a plugin I create a new empty app add the platform I want to develop the plugin for and I use xcode or eclipse/android studio to run the app while developing the plugin – jcesarmobile Jul 16 '15 at 06:06

0 Answers0