serkan stack
serkan stack

Reputation: 155

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

I want to work with firebase real time database with this link.. After 6th step, it gives

Failed to resolve

error.

build.gradle App module:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "24.0.0"

    defaultConfig {
        applicationId "gc.imageuploader"
        minSdkVersion 14
        targetSdkVersion 23
        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:23.4.0'
    compile 'com.google.firebase:firebase-database:9.6.1'
}
apply plugin: 'com.google.gms.google-services'

build.gradle Project module:

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

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.2'
        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()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

So how Can I solve this problem? What should I do? What do you think about this problem?

Upvotes: 0

Views: 822

Answers (1)

Ferdous Ahamed
Ferdous Ahamed

Reputation: 21736

Make sure you have the latest version of 'Google Play services' and 'Google Repository' installed while using Firebase.

Please follow below steps:

  1. Open Android studio
  2. Go to the Menu bar > Tools > Android > SDK Manager
  3. Click on Tab > SDK Tools
  4. Check and install 'Google Play Services' and 'Google Repository'
  5. Click on Apply and wait for the download

Finally, Sync and build your project again.

Upvotes: 1

Related Questions