Reputation: 430
I'm trying to use Firebase in my app.
After adding three lines to Gradle, I get this error:
Error:(27, 13) Failed to resolve: com.google.firebase:firebase-core:9.8.0
Here are some images of my code:
Why am I getting this error?
Upvotes: 14
Views: 8163
Reputation: 180
As described here, add this:
dependencies {
// ...
classpath 'com.google.gms:google-services:3.0.0'
}
In your project level gradle file and this one in the app level gradle file:
dependencies {
compile 'com.google.firebase:firebase-core:9.8.0'
}
apply plugin: 'com.google.gms.google-services'
Upvotes: 1
Reputation: 4800
I guess, you need to update google repository. Try running SDK manager and check if there is any update.
Look at the comment in sample here
dependencies {
// ...
compile 'com.google.firebase:firebase-core:9.8.0'
// Getting a "Could not find" error? Make sure you have
// the latest Google Repository in the Android SDK manager
}
Getting a "Could not find" error? Make sure you have the latest Google Repository in the Android SDK manager
Go to SDK Manager -> Extras and check of updates.
Upvotes: 8
Reputation: 726
Make sure the Google Repository and its related repostories has been updated to the latest version. Check by going to the SDK Manager -> Extras Section.
Upvotes: 16