Accepted answer

For Android Studio ,you need to change below line in Gradle App level inside build.gradle just change compile for implementation. 

dependencies {
    compile 'com.android.support:support-v4:27.0.3'
}

Should be:

dependencies {
    implementation 'com.android.support:support-v4:27.0.3'
}
Accepted answer

 Complete answer for this issue. you need to the 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

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.

Just add from build.gradle from build script

classpath 'com.google.gms:google-services:3.2.0'

and all of the dependencies "compile" replace to "implementation".