将“排除模块"规则添加到Cordova的plugin.xml中的条目中 [英] Add an “exclude module” rule to an entry in plugin.xml for Cordova
问题描述
我在尝试构建我的phonegap项目时遇到了这个错误
I'm stucking with this error trying to build my phonegap project
据我所知,这个错误是因为在项目中两次设置了一个库. 我检查了所有库,发现只有一个库导致此问题(在我的一个插件中找到)
As far I know this error because there is a library is set twice in the project. I check all my libraries and I found only one library causing this(found in one of my plugins)
<framework src="com.android.support:design:23.4.0"/>
问题是,我可以在plugin.xml文件中设置排除模块规则吗? 我想我需要排除com.android.supportv4
The thing is, can I set an exclude module rule in the plugin.xml file? I think I need to exclude com.android.supportv4
推荐答案
最后,我解决了它,我必须在包含以下几行的插件中创建一个build-extras.gradle文件:
Finally I resolved it, I had to create a build-extras.gradle file in my plugin containing the following lines:
configurations {
all*.exclude group: 'com.android.support', module: 'support-v4'
all*.exclude group: 'com.android.support', module: 'support-annotations'}
然后此gradle文件需要使用以下命令导入plugin.xml文件中:
Then this gradle file need to imported in plugin.xml file using:
<framework src="build-extras.gradle" custom="true" type="gradleReference" />
这篇关于将“排除模块"规则添加到Cordova的plugin.xml中的条目中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!