How to create a Cordova plugin with `plugman`

Create plugin

plugman create --name torovinSquareup --plugin_id cordova-plugin-torovinsquareup --plugin_version 0.0.1

Add the android platform to your plugin*

cd torovinsquareup
plugman platform add --platform_name android

Creates a package.json file in the plugin based on values from plugin.xml

plugman createpackagejson .

# plugman createpackagejson <directory>
# You can use . for your current directory.

Important: if you have added android platform

If you have added android platform, you need to change package name for android platform.

  1. in src/android/torovinsquareup.java file: package name is package cordova-plugin-torovinsquareup
    you need to replace - (dash) with . (dot)
    So, correct package name will be package cordova.plugin.torovinsquareup

  2. in plugin.xml file, change value of <param name="android-package" nested inside <platform name="android">
    Here also, you need to replace - (dash) with . (dot)
    Correct code is:<param name="android-package" value="cordova.plugin.torovinsquareup.torovinsquareup" />

Topic: