Android Studio中有六种依赖(Compile,Provided,APK,Test compile,Debug compile,Release compile)

原文地址:http://blog.csdn.net/u010090644/article/details/50955141


Android Studio中,开发会常用的6中依赖方法。



1.Compile

compile是对所有的build type以及favlors都会参与编译并且打包到最终的apk文件中。

2.Provided

Provided是对所有的build type以及favlors只在编译时使用,类似eclipse中的external-libs,只参与编译,不打包到最终apk。

3.APK

只会打包到apk文件中,而不参与编译,所以不能再代码中直接调用jar中的类或方法,否则在编译时会报错

4.Test compile

Test compile 仅仅是针对单元测试代码的编译编译以及最终打包测试apk时有效,而对正常的debug或者release apk包不起作用。

5.Debug compile

Debug compile 仅仅针对debug模式的编译和最终的debug apk打包。

6.Release compile

Release compile 仅仅针对Release 模式的编译和最终的Release apk打包。


来源:网络


智能推荐

Compile FreeCAD on Windows

Compile FreeCAD on Windows [email protected] 1.Introduction FreeCAD是一个参数化的三维造型软件,主要用于任意大小的实际模型的设计。参数化的建模方式可以通过修改相关参数从而方便地修改你的设计。FreeCAD是开源软件,并提供了便利地自定义方式,也提供了脚本,从而根据自己的需要去扩展功能。FreeCAD是跨平台(Windows, Mac和Lin...

codeblock找不到compile

在codeblock找不到compile的问题,就算你按了auto-detect也没用,找不到MinGW(其实也不怪这个) 解决办法就是:换个版本,看到没就是选有MinGW。(你下载的估计是没有MinGW的) 看下安装包大小也知道了,两个版本大小不一样 还有就是安装过程中你看(多了个MinGW的) 然后你进来再点就能找到了...

android gradle依赖:implementation 和compile的区别

android gradle依赖:implementation 和compile的区别 3.0后gradle依赖的不同写法和意义   2017 年google 后,Android studio版本更新至3.0,更新中,连带着com.android.tools.build:gradle 工具也升级到了3.0.0,在3.0.0中使用了最新的Gralde 4.0 里程碑版本作为gradle的编...

android gradle依赖:implementation 和compile的区别

2017 年google 后,Android studio版本更新至3.0,更新中,连带着com.android.tools.build:gradle 工具也升级到了3.0.0,在3.0.0中使用了最新的Gralde 4.0 里程碑版本作为gradle的编译版本,该版本gradle编译速度有所加速,更加欣喜的是,完全支持Java8。 当然,对于Kotlin的支持,在这个版本也有所体现,Kotlin...

android gradle依赖:implementation 和compile的区别

可以看到在Android studio3.0中,compile依赖关系已被弃用,被implementation和api替代,provided被compile only替代,apk被runtime only替代。 我们先来看看implementation和api的区别: api:跟 2.x 版本的 compile完全相同 implementation:使用了该命令编译的依赖,它仅仅对当前的Moudl...

猜你喜欢

Android Studio 查看Compile 导入的包的位置

                其实就是以Project的视图模式来查看的时候点开External Libraries,这里面就是所有的compile的包了 查看具体的电脑中的位置:右击某个,然后点击Libarary Properties sourc...

搭建一个flutter项目的全步骤

下载Flutter  SDK  解压到  C:\src\flutter  将路径C:\src\flutter\bin  添加到系统变量Path中   下载 Android Studio  安装  并安装Flutter插件 File > Settings > ...

python的列表

len(列表):返回列表长度 max(列表):返回列表最大值 min(列表):返回列表的最小值 sort reverse enumberate:把索引+元素组成元组再构成数组 zips:把两个列表的对应元素组成元组再构成数组     reverse      ...

Centos7 安装cloudera manager5.13.1记录

CDH安装资源下载 cm安装包地址:https://archive.cloudera.com/cm5/cm/5/ CDH安装包位置:http://archive.cloudera.com/cdh5/parcels/latest/ MySql安装包位置:https://repo.mysql.com//mysql57-community-release-el7-8.noarch.rpm 建议mysql...

iOS - UIWindow

前言 1、Window 的创建 Objective-C Swift 2、UIScreen 的使用 UIScreen 的属性 scale 属性的进一步的说明: 以前的 iPhone 设备屏幕分辨率都是 320x480,后来 apple 在 iPhone 4 中采用了名为 Retina 的显示技术,iPhone 4 采用了 960x640 像素分辨率的显示屏幕。由于屏幕大小没有变,还是 3.5 英寸,...

问答精选

Best index for mysql date field

I´ve got a table with 41,000,000 rows with the following structure: What is the best index for date to enable a quick filtering like this select count(*) from market_db_candle where date >= 2...

Is it correct application of the SRP(single responsibility principle)?

I have a java class: I can receive a map of new values in these fields and update it. It looks like this: ChangeItem changeItem where changeItem.key is field's name and changeItem.value is the field's...

Display the variable names of an array sort?

** This is my first post on StackOverflow, and I code only in high school, so I am by no means a professional. I am in fact quite novice XD. What's also important to note is that I'm using ReadyToProg...

Choose Header in ASP.NET Page

I have created a master page (Site.master) which contains the code to display a header, a footer, and a side bar. It works really great, but I am having trouble figuring out how to dynamically choose ...

voiceXML in evolution.voxeo.com, getting strange error

I am new in voiceXML and I am trying to use evolution.voxeo.com to run simple XML codes. According to their website, we can post the recorded audio in multi-part format. So here is my XML code, that r...

相关问题

相关文章

热门文章

推荐文章

相关标签

推荐问答