SaTech
SaTech

Reputation: 430

Error:(27, 13) Failed to resolve: com.google.firebase:firebase-core

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:

this is in the application Gradle this is something else this is in the application Gradle

Why am I getting this error?

Upvotes: 14

Views: 8163

Answers (3)

Zubair Soomro
Zubair Soomro

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

bilal_azam
bilal_azam

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.

SDK manager's snapshot

Upvotes: 8

skynet
skynet

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.

enter image description here

Firebase Doc Link

Upvotes: 16

Related Questions