Anant Shah
Anant Shah

Reputation: 4044

Failed to Resolve: compile 'com.google.firebase:firebase-config:9.2.1'

I am getting following Error while adding Firebse Remote Config SDK in Gradle file

compile 'com.google.firebase:firebase-config:9.2.1'

It will shows error of Error:(25, 13) Failed to resolve: com.google.firebase:firebase-config:9.2.1 Show in File
Show in Project Structure dialog

Gradle File:

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.0"

    defaultConfig {
        applicationId "com.bazingalabs.firebaseremoteconfig"
        minSdkVersion 15
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:24.0.0'
    compile 'com.google.firebase:firebase-config:9.2.1'


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

Error Imageenter image description here

Upvotes: 7

Views: 4618

Answers (3)

Dharmaraj
Dharmaraj

Reputation: 1306

Add this below of your dependencies:

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

Upvotes: 0

Anant Shah
Anant Shah

Reputation: 4044

@RiyazAhamed Thank you. Solutions was Update the 'Google Play Services' and 'Google Repository' from sdk manager and restart Android studio.

Upvotes: 18

Geet Choubey
Geet Choubey

Reputation: 1077

There is a bug in this:

Add this to your gradle file.

packagingOptions {
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/LICENSE-FIREBASE.txt'
    exclude 'META-INF/notice'
}

I have used Firebase Messaging

It should look like this

Gradle:App

apply plugin: 'com.google.gms.google-services' //Usually they put this at the bottom (below dependencies {}
                                               // but it worked for me at the top also

android {
   defaultConfig { ... }
   buildTypes { .... }

    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE-FIREBASE.txt'
        exclude 'META-INF/notice'
    }
}

dependencies {
      compile fileTree(include: ['*.jar'], dir: 'libs')
      testCompile 'junit:junit:4.12'
      compile 'com.google.firebase:firebase-core:9.2.1'
      compile 'com.firebaseui:firebase-ui:0.3.1'
      compile 'com.google.firebase:firebase-messaging:9.2.1'
}

Gradle: Project

dependencies {
    ...
    classpath 'com.google.gms:google-services:3.0.0'

}

Upvotes: 0

Related Questions