老师,compileOnly 和 implementation究竟有什么区别呢?
来源:3-2 登录模块组件化概述

菲迪亚斯
2020-04-14
我在lib_common_ui里compileOnly了appcompact库和magicindicator库,但是build的时候就会报错:
Cannot find a version of ‘androidx.appcompat:appcompat’ that satisfies the version constraints:
Dependency path ‘mymusic:lib_common_ui:unspecified’ --> 'androidx.appcompat:appcompat:1.0.2’
Constraint path ‘mymusic:lib_common_ui:unspecified’ --> ‘androidx.appcompat:appcompat:{strictly 1.0.0}’ because of the following reason: debugRuntimeClasspath uses version 1.0.0
Dependency path ‘mymusic:lib_common_ui:unspecified’ --> ‘com.github.hackware1993:MagicIndicator:1.5.0’ --> ‘androidx.appcompat:appcompat:1.0.0’
因为我的appcompact版本是1.0.2
’androidx.appcompat:appcompat:1.0.2’
这个错误的原因是什么呢?是因为找不到合适的版本吗,为什么使用implementation方式依赖的话就不会出错?
1回答
-
qndroid
2020-04-15
一个是真的引入依赖,一个是占位编译,肯定不一样,具体区别可以百度一下,不是啥新东西了。
10
相似问题