解决Configuration 'compile' is obsolete and has been replaced with implementation
项目中Gradle版本升级到4.4后,项目构建时,每次出现红色的警告信息:
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation'.
It will be removed at the end of 2018
Affected Modules: MyCorn-MyCorn
复制代码
但本地项目代码中compile都已经完成了implementation,警告信息依然出现。 一开始百思不得解,警告信息相对过于简单,且对应模块也已经全部完成了替换。
最终考虑使用命令进行项目构建过程,以期望能获取具体的进一步详情信息,因此,输出完整debug日志。
./gradlew assembleDevDebug --debug > ~/T/gralde.log
复制代码
输出的gralde.log日志信息很大,搜索对应的警告信息。
...
17:17:48.796 [DEBUG] [org.gradle.internal.progress.DefaultBuildOperationExecutor] Build operation 'Apply plugin corn-auto-collector to project ':MyCorn'' started
17:17:48.802 [DEBUG] [org.gradle.api.internal.artifacts.mvnsettings.DefaultLocalMavenRepositoryLocator] No local repository in Settings file defined. Using default path: /Users/corn/.m2/repository
17:17:48.805 [WARN] [org.gradle.api.Project] WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation'.
It will be removed at the end of 2018
17:17:48.860 [DEBUG] [org.gradle.internal.progress.DefaultBuildOperationExecutor] Completing Build operation 'Apply plugin corn-auto-collector to project ':MyCorn''
...
复制代码
对应的,我们发现是项目中应用了自实现的corn-auto-collector插件,而插件中并未将compile替换成implementation。
修改对应插件的依赖配置,重新构建发现警告信息消失。
Android Studio默认构建时日志是-q级别输出,在必要的时候我们可以修改默认构建日志输出级别。 最常用的有两种方式:
1,修改Android Studio >> Preferences >> Build >> Compiler >> Command-line Options,加入对应日志级别参数,如常用的--debug,--stacktrace;
2,直接使用对应的gradle命令,加上对应的命令参数。
实际项目构建过程中,出现的构建问题,往往日志信息都很简单,并不能一次性定位到问题所在,通过附加参数形式的去获取完整的日志信息,以便详细定位到项目构建过程中的具体问题,非常有效,在实际项目构建过程可以经常使用。
作者:HappyCorn
链接:https://juejin.im/post/5caf35d7e51d456e7079f1f0
来源:掘金
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
解决Configuration 'compile' is obsolete and has been replaced with implementation的更多相关文章
- Android Studio3.1.2升级问题:Configuration 'compile' is obsolete and has been replaced with 'implementation'.
每次升级Android Studio时,一般情况下Gradle版本的也会相应的升级,我之前Android Studio 3.0.1.Gradle 是4.1升级后为:Android Studio 3.1 ...
- 安卓 android studio 报错 WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and
报错截图: 问题原因:compile会被在2018年底取消,会被imlementation替代,所以会报这个警告,解决警告的方式就是换成 imlementation 就好了 解决方法: 在 app 的 ...
- WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
点击报错信息中的app, 按照提示,修改compile 为 implementation 再次同步即可 结果
- Warning:Configuration 'compile' is obsolete and has been replaced with 'implementation'. It will be
1.替换 compile为implementation. 2.file->invalidate caches 或者build中的clear
- API 'variant.getJavaCompiler()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()'
WARNING: API 'variant.getJavaCompiler()' is obsolete and has been replaced with 'variant.getJavaComp ...
- react-native Android WARNING: API 'variant.getMergeAssets()' is obsolete and has been replaced with 'variant.getMergeAssetsProvider()'.
android Studio 中打开react-native项目的android文件夹 在sync的过程中 发生warning: WARNING: API 'variant.getMergeAsset ...
- 如何在Android studio上运行从github上下载的RN项目
想要编译别人的RN项目,还是要踩踩坑才能走上正轨啊,分享下我试过多种方法后最喜欢的方法(其实是因为我多次用VS Code编译都是以失败而告终,所以才选择的studio) 注意:这一步是你的开发环境都安 ...
- Android Studio 升级为3.1 踩到的坑
原文:https://blog.csdn.net/xiariluoxue/article/details/80050700 AndroidStudio.gradle.buildToolsVersion ...
- 【转】AndroidStudio升到最新版本(3.1.2)之后
AndroidStudio升到最新版本(3.1.2)之后 暂时发现的需要大家注意的地方 1.androidstudio3无法导入moudle? 例如:我写了一个简单的项目,需要导入一个第三方的mo ...
随机推荐
- javascript中字符串和字符串变量的问题
var s = new String("hello"); s.indexOf(1) = 'p'; //错误,indexof()是函数 s[1]='p' //错误,在c和c++可以改 ...
- 3、js无缝滚动轮播
另一个无缝滚动轮播,带暂停,由于js是异步,用C面向过程的思想开始会很怪异很怪异,因为当你定时器里面需要执行的函数时间比较长或是有一段延时时,异步的代码会完全不同,但习惯就好了. 这个代码有几个问题, ...
- .NET面试常考算法
1.求质数 质数也成为素数,质数就是这个数除了1和他本身两个因数以外,没有其他因数的数,叫做质数,和他相反的是合数, 就是除了1和他本身两个因数以外,还友其他因数的数叫做合数. 1 nam ...
- Web开发:需收藏的JavaScript常用技巧
原文来自:https://www.baidu.com/home/news/data/newspage?nid=4242707244478773456&n_type=0&p_from=1 ...
- Servlet到底是单例还是多例你了解吗?
为一个Java Web开发者,你一定了解和学习过Servlet.或许还曾在面试中被问到过Servelt是单例还是多例这个问题. 遇到这个问题,你是否曾深入了解过,还是百度或者Google了一下,得到答 ...
- ETCD相关介绍--整体概念及原理方面
etcd作为一个受到ZooKeeper与doozer启发而催生的项目,除了拥有与之类似的功能外,更专注于以下四点. 简单:基于HTTP+JSON的API让你用curl就可以轻松使用. 安全:可选SSL ...
- tkinter中鼠标与键盘事件(十五)
鼠标与键盘事件 import tkinter wuya = tkinter.Tk() wuya.title("wuya") wuya.geometry("300x200+ ...
- 富文本编辑器UEditor自定义工具栏(三、自定义工具栏功能按钮图标及工具栏样式简单修改)
导读 富文本编辑器UEditor提供丰富了定制配置项,如果想设置个性化的工具栏按钮图标有无办法呢?答案是肯定的!前两篇博文简要介绍了通过将原工具栏隐藏,在自定义的外部按钮上,调用UEditor各命令实 ...
- VM10虚拟机安装图解
支持32位windows操作系统和64位操作系统的VM10虚拟机 ============= 下载虚拟机: VM10虚拟机下载网址+Vm10的激活秘钥 https://jingyan.baidu.c ...
- Python eval 函数妙用
eval 功能:将字符串str当成有效的表达式来求值并返回计算结果. 语法: eval(source, globals, locals) -> value 参数: source:一个Python ...