Failed to resolve: com.google.firebase:firebase-co

2019-01-01 03:40发布

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?

11条回答
唯独是你
2楼-- · 2019-01-01 03:59

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.

查看更多
君临天下
3楼-- · 2019-01-01 04:02

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.

查看更多
回忆,回不去的记忆
4楼-- · 2019-01-01 04:05

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

查看更多
伤终究还是伤i
5楼-- · 2019-01-01 04:05
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()
    }
}
查看更多
时光乱了年华
6楼-- · 2019-01-01 04:05

If using command line tools, do

sdkmanager 'extras;google;m2repository'
sdkmanager 'extras;android;m2repository'
查看更多
皆成旧梦
7楼-- · 2019-01-01 04:06

Need to Update

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

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

查看更多
登录 后发表回答