安卓笔记侠

专注安卓开发

导航

AndroidStudio 3.0升级之compile、implementation简要说明

1.现象

androidStudio 升级至3.0后 之前引用库所使用的complie默认变成implementation
如以下:
    3.0之前
    compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
    compile 'io.reactivex.rxjava2:rxjava:2.1.3'

    3.0之后
    implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
    implementation 'io.reactivex.rxjava2:rxjava:2.1.3'
除以上之外,还有以下:

 androidTestCompile(前)  
 androidTestImplementation(后)  


 testCompile(前)
 testImplementation (后)

截图所示:

desc.png

以上两指令说明

compile: 如有模块之间存在依赖的话,引用是正常的。
implementation: 引用的库只能在当前模块中使用,即便模块之间存在依赖关系的话,也不可以引用。

说到以上,举一个不是很恰当的例子,有点像:Java中 public 与 private

 

posted on 2018-01-25 19:52  安卓笔记侠  阅读(3132)  评论(0编辑  收藏  举报