Add a dependency to an Android Cordova plugin

前端 未结 2 836
伪装坚强ぢ
伪装坚强ぢ 2020-12-31 04:27

I\'m building a Cordova Android plugin. I want to use a 3rd party View inside an Intent that is created by the plugin

相关标签:
2条回答
  • 2020-12-31 04:42

    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

    0 讨论(0)
  • 2020-12-31 04:52

    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" />
    
    0 讨论(0)
提交回复
热议问题