解决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 ...
随机推荐
- break-跳出内循环
i = 1 j = 1 while i <= 10: print('第%d个碗' % i) while j <= 10: if j == 5: break else: print('这是内 ...
- css 选择器【转】
最近在研究jQuery的选择器,大家知道jQuery的选择器和css的选择器非常相似,所以整理一下css选择器: css1-css3提供非常丰富的选择器,但是由于某些选择器被各个浏览器支持的情况不一样 ...
- python爬虫入门(七)Scrapy框架之Spider类
Spider类 Spider类定义了如何爬取某个(或某些)网站.包括了爬取的动作(例如:是否跟进链接)以及如何从网页的内容中提取结构化数据(爬取item). 换句话说,Spider就是您定义爬取的动作 ...
- android获取手机机型、厂商、deviceID基本信息
/** * 系统工具类 */ public class SystemUtil { /** * 获取当前手机系统语言. * * @return 返回当前系统语言.例如:当前设置的是"中文-中国 ...
- Spring Boot实战笔记(一)-- Spring简介
一.Spring 概述 Spring框架是一个轻量级的企业级开发的一站式解决方案.所谓的解决方案就是可以基于Spring解决所有的Java EE开发的所有问题. Spring框架主要提供了Ioc(In ...
- Tomcat配置与优化(内存、并发、管理)与性能监控
原文链接:http://blog.csdn.net/xyang81/article/details/51530979 一.JVM内存配置优化 在开发当中,当一个项目比较大时,依赖的jar包通常比较多, ...
- jQuery中 $.ajax()方法详解
$.ajax()方法详解 jquery中的ajax方法参数总是记不住,这里记录一下. 1.url: 要求为String类型的参数,(默认为当前页地址)发送请求的地址. 2.type: 要求为Strin ...
- Latex 公式换行问题,(换行,等号对齐)
1. 换行后等式对齐 \begin{equation} \begin{aligned} R(S_2)&= p_2\cdot S_2=\sum_{i\in \mathcal{I}^+(p_2)} ...
- rest_framework之解析器、路由控制、分页
解析器 我们都知道,网络传输数据只能传输字符串格式的,如果是列表.字典等数据类型,需要转换之后才能使用 但是我们之前的rest_framework例子都没有转换就直接可以使用了,这是因为rest_fr ...
- Ubuntu 16.04下安装64位谷歌Chrome浏览器
1.进入 Ubuntu 16.04 桌面,按下 Ctrl + Alt + t 键盘组合键,启动终端. 也可以按下 Win 键(或叫 Super 键),在 Dash 的搜索框中输入 terminal 或 ...