天使漫步IT工作室

Configuration 'compile' is obsolete and has been replaced with 'implementation'. It will be removed at the end of 2018

一、问题描述:

android stadio 升级到3.1以后会更新各种依赖插件,最后发现在gradle编译以后,出现如下警告:

Configuration 'compile' is obsolete and has been replaced with 'implementation'.
It will be removed at the end of 2018


Configuration 'testCompile' is obsolete and has been replaced with 'testImplementation'.
It will be removed at the end of 2018


Configuration 'testApi' is obsolete and has been replaced with 'testImplementation'.
It will be removed at the end of 2018


Configuration 'compile' is obsolete and has been replaced with 'implementation'.
It will be removed at the end of 2018


Configuration 'testCompile' is obsolete and has been replaced with 'testImplementation'.
It will be removed at the end of 2018


Configuration 'testApi' is obsolete and has been replaced with 'testImplementation'.
It will be removed at the end of 2018


Configuration 'compile' is obsolete and has been replaced with 'implementation'.
It will be removed at the end of 2018


Configuration 'debugCompile' is obsolete and has been replaced with 'debugImplementation'.
It will be removed at the end of 2018


Configuration 'releaseCompile' is obsolete and has been replaced with 'releaseImplementation'.
It will be removed at the end of 2018


Configuration 'testCompile' is obsolete and has been replaced with 'testImplementation'.
It will be removed at the end of 2018


Configuration 'testApi' is obsolete and has been replaced with 'testImplementation'.
It will be removed at the end of 2018


Configuration 'compile' is obsolete and has been replaced with 'implementation'.
It will be removed at the end of 2018


Configuration 'testCompile' is obsolete and has been replaced with 'testImplementation'.
It will be removed at the end of 2018


Configuration 'testApi' is obsolete and has been replaced with 'testImplementation'.
It will be removed at the end of 2018


Configuration 'compile' is obsolete and has been replaced with 'implementation'.
It will be removed at the end of 2018


Configuration 'testCompile' is obsolete and has been replaced with 'testImplementation'.
It will be removed at the end of 2018


Configuration 'testApi' is obsolete and has been replaced with 'testImplementation'.
It will be removed at the end of 2018


Configuration 'compile' is obsolete and has been replaced with 'implementation'.
It will be removed at the end of 2018


Configuration 'testCompile' is obsolete and has been replaced with 'testImplementation'.
It will be removed at the end of 2018


Configuration 'testApi' is obsolete and has been replaced with 'testImplementation'.
It will be removed at the end of 2018


Configuration 'compile' is obsolete and has been replaced with 'implementation'.
It will be removed at the end of 2018


Configuration 'testCompile' is obsolete and has been replaced with 'testImplementation'.
It will be removed at the end of 2018


Configuration 'testApi' is obsolete and has been replaced with 'testImplementation'.
It will be removed at the end of 2018


Configuration 'compile' is obsolete and has been replaced with 'implementation'.
It will be removed at the end of 2018


Configuration 'androidTestApi' is obsolete and has been replaced with 'androidTestImplementation'.
It will be removed at the end of 2018


Configuration 'testCompile' is obsolete and has been replaced with 'testImplementation'.
It will be removed at the end of 2018


Configuration 'testApi' is obsolete and has been replaced with 'testImplementation'.
It will be removed at the end of 2018


Configuration 'androidTestCompile' is obsolete and has been replaced with 'androidTestImplementation'.
It will be removed at the end of 2018

二、解决办法:

compile会被在2018年底取消,被api替代成implementation,所以会报这个警告,解决警告的方式就是换成api就好了。

即:gradle中的compile 换成 implementation 即可。

以此类推:

所有的api替换为右边的新api,再编辑警告即可解除。

三、解释

关于compile与implementation的区别:

即功能相同,只是在编译上作了一些优化。

当前页面是本站的「Google AMP」版。查看和发表评论请点击:完整版 »