exclude modules when config dependencies
2015-12-16 00:00
155 查看
Plaform: Android;
Tools: Idea Intellij, Android SDK, gradle;
Sometimes there are multiple projects in a root project, and one project would refer to other projects as dependencies, if more than one projects contain the same library, it will cause "Multiple dex files define" error when building release version. "exclude" instruction would help us solve this problem.
First, check out those modules which being mulitple include:
gradlew -q :%module%:dependencies
Then edit "build.gradle" file in your application module, exlude them. In my case, I get rid of v7, v4 and annotations from a library module named "memorize":
dependencies {
compile(project(':memorize')) {
exclude group: 'com.android.support', module: 'appcompat-v7'
exclude group: 'com.android.support', module: 'support-v4'
exclude group: 'com.android.support', module: 'support-annotations'
exclude module: 'ActiveAndroid'
}
Tools: Idea Intellij, Android SDK, gradle;
Sometimes there are multiple projects in a root project, and one project would refer to other projects as dependencies, if more than one projects contain the same library, it will cause "Multiple dex files define" error when building release version. "exclude" instruction would help us solve this problem.
First, check out those modules which being mulitple include:
gradlew -q :%module%:dependencies
Then edit "build.gradle" file in your application module, exlude them. In my case, I get rid of v7, v4 and annotations from a library module named "memorize":
dependencies {
compile(project(':memorize')) {
exclude group: 'com.android.support', module: 'appcompat-v7'
exclude group: 'com.android.support', module: 'support-v4'
exclude group: 'com.android.support', module: 'support-annotations'
exclude module: 'ActiveAndroid'
}
相关文章推荐
- 泛型
- TextView 添加属性自带滚动
- BarTender#3246错误解决
- 安装XAMPP后在终端输入mysql出现的问题
- 关于UITextView的Xcode一个bug
- 动画曲线
- 使用AFN上传图片
- Mac磁盘诊断如何通过EasyRecovery完成
- 获取客户端ip地址
- 高德坐标转百度坐标
- 区间选点问题(贪心)
- java对象与Map互转
- java对象的一些基本操作,复制对象,判断是否为基本数据类型等
- 读取文件
- 流读成字符串和字节数组
- 将java集合转换成map
- Gson详解:Java对象与JSON相互转换的利器
- 重要的是坚持
- Sublime Text 学习笔记
- ios端与java之间的RSA算法加密