Jon Worek
Jon Worek

Reputation: 351

Can't update cordova plugin after first install via plugman

I'm developing a Cordova plugin.

Versions:

I install the plugin into a sample project I've created, like so:

plugman install --platform android --project ../cordova-echo-example-app/platforms/android --plugin .

The plugin installs into the project successfully, and I can build my sample app.

I change some code, and try to update the plugin again using the same above command, and I get the following error:

Cannot find plugin.xml for plugin "plugins". Please try adding it again.

I tried to uninstall the plugin, then install again, but still get the same error.

If I delete the platforms/ directory from my sample app, I'm able to install the plugin again. I'd like to not have to do this step every time though.

Here's what my plugin.xml file looks like:

<?xml version='1.0' encoding='utf-8'?>
<plugin id="cordova-echo-example-plugin" version="0.0.1" 
  xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
  <name>cordova-echo-example-plugin</name>
  <js-module name="cordova-echo-example-plugin" src="www/echo.js">
    <clobbers target="cordova.plugins.cordova-echo-example-plugin"/>
  </js-module>
  <platform name="android">
    <config-file parent="/*" target="res/xml/config.xml">
      <feature name="Echo">
        <param name="android-package" value="com.jonworek.echo"/>
      </feature>
    </config-file>
    <config-file parent="/*" target="AndroidManifest.xml"></config-file>
    <source-file src="src/android/Echo.java" target-dir="src/com/jonworek/echo"/>
  </platform>
</plugin>

How can I update my plugin in my sample project without going through these steps and avoiding that error?

Upvotes: 0

Views: 315

Answers (1)

Jon Worek
Jon Worek

Reputation: 351

It looks like plugman didn't like the . path reference for the --plugin parameter when it tries to reinstall. Changing the command to:

plugman install --platform android --project ../cordova-echo-example-app/platforms/android/ --plugin ../cordova-echo-example-plugin/

solved the issue.

Upvotes: 1

Related Questions