Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 389
Parth Avatar asked Jun 14 '18 15:06

Parth


2 Answers

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

like image 153
Parth Avatar answered Nov 15 '22 06:11

Parth


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.

like image 43
JavaCafe01 Avatar answered Nov 15 '22 06:11

JavaCafe01