Error Configuration 'compile' is obsolete and has been replaced with 'implementation' and api

夙愿已清 提交于 2021-02-13 12:12:05

问题


Recently I Have updated android studio with build tools and apis.

While syncing current project i am getting error like: "Error Configuration 'compile' is obsolete and has been replaced with 'implementation and 'api'. how to fix this error.


回答1:


I found a Complete solution for this issue. here is a simple explanation for changes in you build.gradle file.

  • You have to replace compile with api where ever you are using any api ref. like: volley, GitHub dependancy.strong text
  • You have to replace compile with implementation where ever you are using android library like play-services-maps,appcompat-v7 etc

ref




回答2:


The compile configuration is deprecated, so you will have to use implementation configuration instead. Under dependencies, in your app module's build.gradle, replace compile with implementation.



来源:https://stackoverflow.com/questions/50860646/error-configuration-compile-is-obsolete-and-has-been-replaced-with-implementa

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!