gradle android的依赖配置dependencies
来源:互联网 发布:阿里云域名过户怎么过 编辑:程序博客网 时间:2024/06/08 09:25
/** * 配置仓库 */repositories{ //本地扁平目录仓库 flatDir{ dir('libs') } jcenter()}/** * 自定义dependencies过滤组 * 因为dependencies只支持基本的风味分组 比如free x86 arm等 不支持组合 * 这样定义后就支持组合了 */configurations{ freeArmDebugCompile{}}/** * 调用./gradlew :app:dependencies 查看依赖的情况 * * compile 编译(classpatch)+打包apk * apk 仅打包 不参与编译 * provided 只编译 不打包 */dependencies { freeArmDebugCompile 'pub.devrel:easypermissions:0.1.9' androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile 'com.android.support:appcompat-v7:25.3.1' testCompile 'junit:junit:4.12' //引进目录下的所有.jar文件 compile fileTree(include: ['*.jar'], dir: 'libs') //引进指定的jar包 目录相对于build.gradle// compile files('libs/a.jar','libs/b.jar') //导入myLibrary库 并指定配置为release 配和下面补充的第二条 , compile project(path:':mylibrary',configuration:'release') //下面是多种写法 出现重复的时候会自动选择最新的依赖,排除重复依赖 compile 'com.android.support.constraint:constraint-layout:1.0.2' //另外一种写法 compile group:'com.android.support.constraint',name: 'constraint-layout',version: '1.0.2' //使用1开头的最高版本 compile group: 'com.android.support.constraint',name: 'constraint-layout',version: '1.+' //使用最新版本 compile group: 'com.android.support.constraint',name:'constraint-layout',version:'latest.integration' compile 'com.android.support:appcompat-v7:25.3.1' compile 'com.facebook.fresco:fresco:0.14.0',{ //关闭fresco传递的一些依赖 这样会把所有的传递依赖都关闭// transitive false //关闭指定的传递依赖 可以解决依赖冲突 exclude(group:'com.android.support',module:'support-core-utils') } //配置本地扁平仓库support-test-aa.arr 前提必须配置repositories //不建议这么配置 容易缺少依赖 最好配置远程仓库 远程仓库含有pom文件 可以指定依赖// compile name:'support-test-aa',ext:'aar'}
阅读全文
0 0
- gradle android的依赖配置dependencies
- gradle dependencies 无法显示依赖树的问题
- Gradle配置dependencies
- Gradle配置dependencies
- android gradle dependencies
- Android Studio Gradle Dependencies
- android studio build dependencies依赖的库
- Android Studio dependencies依赖
- gradle的简单依赖配置
- Android Studio的Gradle常用命令配置和依赖管理
- Gradle依赖项学习总结,dependencies、transitive、force、exclude的使用与依赖冲突解决
- Gradle依赖项学习总结,dependencies、transitive、force、exclude的使用与依赖冲突解决
- android使用Gradle统一配置依赖版本
- Android使用Gradle统一配置依赖版本
- Android使用Gradle统一配置依赖版本
- Android 使用 Gradle 统一配置依赖管理
- Android - 添加Android的OpenCV依赖库(Android Dependencies) 问题
- android studio 解决Gradle :Resolve dependencies :classpath的办法
- svn安装,配置
- 安卓 三个绘图工具类详解
- Eclipse中的Maven项目报错处理方法
- 心酸的Caffe安装之路 环境搭配 Ubuntu16.04+gtx1080+cuda8.0+cudnn5.1+opencv+Anaconda3+caffe
- rapidjson使用总结
- gradle android的依赖配置dependencies
- OpenResty 最佳实践学习--安装和helloworld(1)
- 泛型(Generics)
- 【Python】【matplotlib】绘图函数
- 3. Longest Substring Without Repeating Characters
- URI和URL的区别(转自: I'M G.Shine)
- Oil Deposits (简单深搜)积水问题
- 区域外点击执行函数
- SQL Server学习笔记1:如何使用软件以及创建第一个数据库