1

I am trying to add firebase into my android app. It's my first time with firebase. I have followed all the instructions from firebase docs but I am getting this error

Error:(26, 13) Failed to resolve: com.google.firebase:firebase-database:11.2.2

Build.gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion 26
buildToolsVersion "26.0.1"

defaultConfig {
    applicationId "..."
    minSdkVersion 21
    targetSdkVersion 26
    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:26.0.0-alpha1'
compile 'com.google.android.gms:play-services:11.0.4'
compile 'com.google.firebase:firebase-database:11.2.2'
}

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

I have also included below line in build.gradle (project) file

classpath 'com.google.gms:google-services:3.1.0'

Android studio version is 2.1.2 Gradle version 2.10

I have also updated google play services and play repository to latest through SDK manager.

Can anybody help please?

U.Ahsan
  • 55
  • 1
  • 10

1 Answers1

0

Update your studio to 3.0 preview and gradle version to

classpath 'com.android.tools.build:gradle:3.0.0-beta4'

Harsh
  • 599
  • 3
  • 20
  • There's no absolute requirement to upgrade Android Studio. This question should have been closed as a duplicate. – Doug Stevenson Sep 09 '17 at 15:59
  • @DougStevenson This is not a duplicate. The solution in the linked question does not solve this issue. Google has some configuration issues with the Firebase 11.2.2 repo. I ended up switching back to 11.2.0 – Ray Sep 19 '17 at 18:57