Cordova Plugin - Add Third Party Sdk
I am trying to create the plugin for the following sdk - https://ktplayhelp.zendesk.com/hc/en-us/articles/221071888-Android In the setup project configuration point it is telling t
Solution 1:
As you can't modify cordovas .gradle file you have to add your own and reference it in your plugin.xml you can do that like this:
<framework src="src/android/*.gradle" custom="true"type="gradleReference" />
This will allow you to do things like compiling an external module. To make this actually work you will have to create an .aar library out of the project you want to integrate.
The resulting gradle-extension will look something like this:
repositories {
jcenter()
flatDir {
dirs'libs'
}
}
dependencies {
compile(name:'KTplay', ext:'aar')
}
android {
packagingOptions {
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
}
}
This assumes that you have put your .aar library in a subdirectory of your plugin named libs. Whats left to do is to ensure that the library actually gets copied during the build process, this is why we have to add it as a resource file in plugin.xml:
<resource-filesrc="libs/KTplay.aar"target="libs/KTplay.aar" />
Post a Comment for "Cordova Plugin - Add Third Party Sdk"