Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gradle 2.2升级gradle3.2+填坑 #7

Open
lyxxman opened this issue May 9, 2018 · 0 comments
Open

gradle 2.2升级gradle3.2+填坑 #7

lyxxman opened this issue May 9, 2018 · 0 comments

Comments

@lyxxman
Copy link
Owner

lyxxman commented May 9, 2018

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 (后)

2.遇到的问题
新建项目工程
主模块添加依赖核心库:XX模块
重新编译后
主模块无法找到XX模块中所引用到的类库 (注:XX模块中里新建的类可以引用)

3.发现问题
细心发现:XX模块中所引用的库资源 全部默认使用implementation
1
4.解决方式
XX模块中所引用的库资源 全部修改并使用 api 主模块引用正常
1
5.以上两指令说明
compile: 如有模块之间存在依赖的话,引用是正常的。
implementation: 引用的库只能在当前模块中使用,即便模块之间存在依赖关系的话,也不可以引用。

说到以上,举一个不是很恰当的例子,有点像:Java中 public 与 private
6.用途
模块间调用

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant