Android : Using gradleReference feature in cordova plugin.xml

on Friday, March 20, 2015


I'm developing a plugin which needs to pull in some additional dependencies. Because I expect the end user to work with Android studio, I am using the gradle build by setting ANDROID_BUILD=gradle.


From what I found, including a gradleReference in the plugin.xml seemed the perfect way to do what I needed. I followed what was done here:


https://github.com/MobileChromeApps/mobile-chrome-apps/blob/master/cordova/cca-hooks-plugin/plugin.xml


including specifying the higher version of plugman, but it doesn't seem to work. The included gradle never seems to be run, and I don't see anything added to the project's build.gradle. I also don't see any errors, however.


I am wondering if this point if the issue is that I am working with released versions of cordova (4.3) and cordova-android (3.7.1) and that possibly I need pre-release versions in order to use gradleReference, but I'm having trouble figuring out exactly what I might need.


My plugin.xml includes:



<framework src="libs/toolkit_library/toolkit.gradle" custom="true" type="gradleReference" />


and this file exists in the plugin with:



dependencies {
compile group: 'com.xxx', name: 'xxx', version: '0.10.0'
}

0 comments:

Post a Comment