【发布时间】:2015-09-17 18:32:41
【问题描述】:
我正在为cordova v5.0.0 做一个插件 该插件适用于 gradle 依赖项,但我需要使用 jar 文件
所以我将文件添加到 plugin.xml 的源代码部分
<platform name="android">
<config-file target="res/xml/config.xml" parent="/*">
<feature name="SygicPlugin">
<param name="android-package" value="com.test.plugi"/>
</feature>
</config-file>
<source-file src="src/android/libs/MyJar.jar" target-dir="src/libs/" />
<source-file src="src/android/MyPlugin.java" target-dir="src/" />
<framework src="src/android/build.gradle" custom="true" type="gradleReference" />
</platform>
这是我的 build.gradle 文件
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
}
但 android 构建过程失败:
MyPlugin.java:4:错误:com.test.jars.model 包不存在 导入 com.jar.jarType;
我找到了很多使用 ant 进行构建的“示例”,但我正在使用 gradle,我想继续使用它。
您知道如何使用插件中的 jar 并正确配置 gradle 以进行构建吗?
提前致谢。
W
【问题讨论】:
标签: android cordova maven gradle phonegap-plugins