14

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?

7
  • did you add apply plugin: 'com.google.gms.google-services' in gradle Nov 1, 2016 at 5:33
  • yeah I already Added it
    – SaTech
    Nov 1, 2016 at 5:37
  • and did you added classpath 'com.google.gms:google-services:3.0.0' in project gradle Nov 1, 2016 at 5:38
  • ' apply plugin: 'com.google.gms.google-services' '
    – SaTech
    Nov 1, 2016 at 5:39
  • compile 'com.google.firebase:firebase-core:9.8.0'
    – SaTech
    Nov 1, 2016 at 5:41

3 Answers 3

16

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

1
  • Thanks alot bro ...I'm trying this solution
    – SaTech
    Nov 1, 2016 at 6:09
8

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

1
  • Thanks alot bro ...I'm trying this solution
    – SaTech
    Nov 1, 2016 at 6:09
1

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'
1
  • thanks Zubair for your help ... I added them before and i modified the question to include screenshots from my code
    – SaTech
    Nov 1, 2016 at 5:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.