升级到Android Studio 3.2.1 ,报Configuration 'compile' is obsolete and has been replaced with 'implementa

升级至Android Studio 3.2.1后,旧的依赖配置如'compile'、'testCompile'将被标记为过时,建议替换为'implementation'、'testImplementation'等。本文详细介绍了解决方案及配置变更的原因。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

升级到Android Studio 3.2.1 ,引入以前公司项目,报

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


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

 

特别注意:

这个只是警告,还可以用可以不改。如果是依赖文件比较多的话,建议别改了吧!

 

解决方式:

compile 改成implementation 
androidTestCompile改成androidTestImplementation 
testCompile 改成testImplementation

 

androidTestCompile、compile、androidTestApi、testCompile、androidTestApi等,会被在2018年底取消(但是还是可以用的,只不过会提示过期而已),会被api等相对于的进行替代,所以会报这个警告,解决警告的方式就是换成对应api就好了。

主要是compile在依赖的时候会传递依赖,这样在项目编译的时候,就会时间比较长。

而与之对应得implementation这个,不可传递依赖引用,比如:B依赖A,C再依赖B,C却不能依赖A的引用或者依赖,当然他的编译时间就会短一些。仅此对应的功能都是一样的
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

被开发耽误的大厨

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值