Add a dependency to an Android Cordova plugin

You have to use your own gradle file then link it on the plugin.xml like this

<framework src="relative/path/your.gradle" custom="true" type="gradleReference" />

You have to put that tag on the plugin.xml, so on plugin install it's read and cordova handles it (not sure how it works internally, but I suppose that it copies the values from your custom .gradle to the main build.gradle).

So you can't test it on your current project, you have to create a new project and add the plugin and see if it works


The Cordova Android plugins doc (in "Adding Dependency Libraries") specify that you can add dependency libraries with the <framework> tag in your plugin.xml.

So for the scissors dependency you can use:

<platform name="android">
    <framework src="com.lyft:scissors:1.0.1" />