Looked around for this solution for much too long now, and I\'m not sure if I missed it or just misstyped something, but my Gradle script will not compile. I am migrating to
compile
is a configuration
that is usually introduced by a plugin (most likely the java plugin) Have a look at the gradle userguide for details about configurations. For now adding the java plugin on top of your build script should do the trick:
apply plugin:'java'
Hope Below steps will help
Add the dependency to your project-level build.gradle:
classpath 'com.google.gms:google-services:3.0.0'
Add the plugin to your app-level build.gradle:
apply plugin: 'com.google.gms.google-services'
app-level build.gradle:
dependencies {
compile 'com.google.android.gms:play-services-auth:9.8.0'
}
Wrong gradle file. The right one is build.gradle in your 'app' folder.
Make sure that you are editing the correct build.gradle
file. I received this error when editing android/build.gradle
rather than android/app/build.gradle
.
In my case I had to remove some files that were created by gradle at some point in my study to make things work. So, cleaning up after messing up and then it ran fine ...
If you experienced this issue in a git project, do git status
and remove the unrevisioned files. (For me elasticsearch
had a problem with plugins/analysis-icu
).
Gradle Version
: 5.1.1
Just for the record: I accidentally enabled Offline work under Preferences -> Build,Execution,Deployment -> Gradle -> uncheck Offline Work, but the error message was misleading