android - 为 Cordova 将 “exclude module” 规则添加到 plugin.xml 中的条目

标签 android cordova mobile phonegap-plugins cordova-plugins

我在尝试构建我的 phonegap 项目时遇到了这个错误

enter image description here
据我所知,这个错误是因为项目中有一个库被设置了两次。
我检查了我所有的库,发现只有一个库导致了这种情况(在我的一个插件中找到)

 <framework src="com.android.support:design:23.4.0"/>

问题是,我可以在 plugin.xml 文件中设置排除模块规则吗?
我想我需要排除 com.android.supportv4

最佳答案

最后我解决了它,我必须在我的插件中创建一个 build-extras.gradle 文件,其中包含以下几行:

configurations {
  all*.exclude group: 'com.android.support', module: 'support-v4'
  all*.exclude group: 'com.android.support', module: 'support-annotations'}

然后这个 gradle 文件需要导入到 plugin.xml 文件中,使用:
<framework src="build-extras.gradle" custom="true" type="gradleReference" />

关于android - 为 Cordova 将 “exclude module” 规则添加到 plugin.xml 中的条目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33375158/

相关文章:

php - 在PHP中检查手机输入

Android 升级后缺少layout_alignParentStart

android - 使用同一个监听器的几个 Activity

android - cordova3.1 未定义的 cordova.plugins

android - phonegap-plugin-facebook-connect : no callback function after FB. 登录

javascript - Cordova:使用带有键盘模拟的外部条形码读取器时的键盘事件

javascript - Sharepoint 的移动应用程序

android - 使用 Android 将数据安全地提交到远程服务器

java - 在 Android 上格式化数字时出现 NoSuchElementException,但在 Java SE 上没有

javascript - JQM 1.4.0 上的自定义转换设置出现 "has no method ' 转换 '"错误?