android studio配置 compileOnly、implementation、api使用

发布时间 2023-10-13 13:20:59作者: adam.li


implementation:作用是编译同时打包,且当前mudule打包的aar或jar, 不能被引用当前module 的模块引用。
api:作用是编译同时打包,且当前mudule打包的aar或jar, 能被引用当前module 的模块引用。
compileOnly:作用是只编译不打包。
比如项目中要引用aarA,如果项目中 其他模块已经引用打包过了aarA,则需要使用compileOnly