Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Did everything according to FB documentation here but I still get the following error when compiling:

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

My SDK manager says that everything is up to date:

Google Play services Rev. 33 installed
Google Repository Rev. 35 installed

This is my build.gradle content:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion '23.0.3'

    defaultConfig {
        applicationId "xxxx.xxxx"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 14
        versionName "1.0"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    // Support libraries
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
    // Google APIs
    // Note: Avoid compiling the entire play-services package.
    compile 'com.google.android.gms:play-services-gcm:9.4.0'
    compile 'com.google.android.gms:play-services-location:9.4.0'
    compile 'com.google.android.gms:play-services-maps:9.4.0'
    compile 'com.google.android.gms:play-services-places:9.4.0'
    compile 'com.google.maps.android:android-maps-utils:0.4.4'

    compile 'org.jsoup:jsoup:1.9.2'
    compile 'com.google.code.gson:gson:2.7'
    compile 'io.branch.sdk.android:library:2.+'
    compile 'com.google.firebase:firebase-core:9.6.0' //<-- CAUSING TROUBLE
}

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

This is my root level build.gradle content:

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

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

allprojects {
    repositories {
        jcenter()
    }
}

Why isn't it compiling?

like image 649
KasparTr Avatar asked Sep 24 '16 08:09

KasparTr


2 Answers

The answer @Lorenzo Quiroli provided will probably help you, you need the same version of Firebase and Google Play Services.

In my case, I had everything set to 9.6.0 but was still getting the error. I solved it by updating to the latest google-play-services and google repository through the SDK Manager:

enter image description here

Now I know this won't help you because you had already updated these, but it might help someone else.

like image 196
SeBsZ Avatar answered Oct 04 '22 14:10

SeBsZ


You need to use the same version of Firebase and Google Play Services. So if you want to update to Firebase 9.6.0 SDK you should also update the other dependencies:

compile 'com.google.android.gms:play-services-gcm:9.6.0'
compile 'com.google.android.gms:play-services-location:9.6.0'
compile 'com.google.android.gms:play-services-maps:9.6.0'
compile 'com.google.android.gms:play-services-places:9.6.0'
like image 34
quiro Avatar answered Oct 04 '22 15:10

quiro