module 的几种依赖方式的区别

module 的几种依赖方式的区别

compile

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

Provided

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

APK

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

Test compile

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

Debug compile

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

Release compile

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

猜你喜欢

转载自blog.csdn.net/CHITTY1993/article/details/78395665