Android学习-Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'

最近运行的时候总是报错:Configuration ‘compile’ is obsolete and has been replaced with ‘implementation’ and ‘api’
在这里插入图片描述

打开build.gradle文件
在这里插入图片描述
鼠标放到黄色底纹区域有提示
在这里插入图片描述
修改版本编号后黄色区域消失。
在这里插入图片描述

点击运行之后又有新的错
在这里插入图片描述

按照提示把compile 替换成implementation即可:
在这里插入图片描述

发布了108 篇原创文章 · 获赞 10 · 访问量 9689

猜你喜欢

转载自blog.csdn.net/liying15/article/details/100940222