compile、implementation和api

问题

最近android studio在打开项目后,自动同步build.gradle配置的时候,Build窗口总是提示:

Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

翻译一下,大概意思就是,‘compile’在2018年底就会被移除,不再支持,让我们用’implementation’ and 'api’替换。后面贴了一个官网的文档地址,我们就去一探究竟吧。

参阅文档

从Android Gradle Plugin 3.0.0开始,'compile’已经被废弃,所以如果你的Plugin版本升级到了3.0.0及以上,AS中肯定会看到这个提示,那就赶紧的使用新的配置吧,早改早轻松。

下面贴下官网对’compile’和’implementation’ and 'api’对比说明:
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qinhai1989/article/details/82797791
今日推荐