6

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.

Parth
  • 1,908
  • 1
  • 19
  • 37

2 Answers2

7

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

Parth
  • 1,908
  • 1
  • 19
  • 37
4

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.

JavaCafe01
  • 162
  • 1
  • 9