[android] Failed to resolve: com.google.firebase:firebase-core:9.0.0

I get the following error while upgrading a firebase project from old domain to new google firebase domain.

Failed to resolve: com.google.firebase:firebase-core:9.0.0

I followed the steps mentioned on the Firebase documentation, in the section Add Firebase to your Android Project, topic Available libraries.

What are my options to resolve this error?

This question is related to android firebase

The answer is


dependencies {
    compile 'com.google.android.gms:play-services-maps:11.8.0'
    compile 'com.google.android.gms:play-services-auth:11.8.0'
    compile 'com.google.android.gms:play-services-ads:11.8.0'
    compile 'com.google.firebase:firebase-storage:11.8.0'

}
apply plugin: 'com.google.gms.google-services'


// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {


        maven { url 'https://maven.fabric.io/public' }

        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'
        classpath 'com.google.gms:google-services:3.1.1'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        google()
    }
}

If using command line tools, do

sdkmanager 'extras;google;m2repository'
sdkmanager 'extras;android;m2repository'

Tried all the above, use the Firebase Assistant! It is the simplest way to solve this. First remove all the dependencies you added to the build.gradle (using the manual method) and then in Android Studio:

Click Tools > Firebase to open the Assistant window.

It really is as easy as that.


If all the above methods are not working then change implementation 'com.google.firebase:firebase-core:12.0.0' to implementation 'com.google.firebase:firebase-core:10.0.0' in your app level build.gradle file. This would surely work.


Error:(30, 13) Failed to resolve: com.google.firebase:firebase-auth:9.6.1

If you ever get this error and you are using Android studio 2.2 that comes with firebase component integrated in it which has libraries version 9.6.0 by default and you are adding the latest dependencies like 9.6.1 . You might need to downgrade com.google.firebase:firebase-auth:9.6.1 to com.google.firebase:firebase-auth:9.6.0

Or check the library version of your pre-installed firebase and make sure it is of the same version with the new library you are trying to add or added to your project.


Go to Android SDK Manager and install the latest version of below two libraries

  1. Google Play Services
  2. Google Repository

Faced myself and seen several times in comments for similar questions - that even after installing "latest" Google Play Services and Google Repository still having the same issue.

The thing is that they may be latest for your current revision of Android SDK Tools, but not that latest your app build requires.

In such case make sure to install latest version of Android SDK Tools first, and probably Android SDK Platform-tools (both under Tools branch). Also please note you may need to go through this several times if you haven't updated for a long time (i.e. install latest Android SDK Tools and Android SDK Platform-tools, then restart Android SDK Manager, then repeat), since the updates seem to be going through some critical mandatory milestones and you cannot install the very latest if you currently have the revision which is pretty "old".

Android SDK Manager - Tools and Platform-tools


In my case, on top of adding google() in repositories for the project level gradle file, I had to also include it in the app level gradle file.

repositories {
    mavenLocal()
    google()
    flatDir {
        dirs 'libs'
    }
}

Need to Update

Android SDK : SDK Tools -> Support Repository -> Google Repository

After updating the Android SDK need to sync gradle build in Android studio.


Following are the prerequisites if you want to add firebase to your project.

  1. For working with Firebase you should install Android Studio 1.5 or higher.
  2. Download the latest Google Play services SDK from through Android SDK Manager.
  3. The device should be running Android 2.3 (Gingerbread) or newer, and Google Play services 9.2.0 or newer.

I could only find out all this after hours of struggle.

Source: Adding Firebase to your Android App