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

版权声明:本文为博主原创文章,不得随意转载,转载请注明出处!!! https://blog.csdn.net/YuDBL/article/details/85995797

升级到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的引用或者依赖,当然他的编译时间就会短一些。仅此对应的功能都是一样的
 

猜你喜欢

转载自blog.csdn.net/YuDBL/article/details/85995797
今日推荐