0

I am trying to build this project Firebase Database Quickstart, but I am facing error in App level build.gradle file.

Here is my error message

Error Message

By searching google and stackoverflow i found some solution then i add this 'com.google.android.gms:play-services-auth:15.0.1' line in my gradle file so my error reduces from 6 to 3.

Error message after adding this 'com.google.android.gms:play-services-auth:15.0.1'

enter image description here

Now i am unable to fix this error.

My Google Play services and Google Repository version is up to date and maven { url "https://maven.google.com" } is already added before in the project level build.gradle.

Here my App Level gradle file:

apply plugin: 'com.android.application'
check.dependsOn 'assembleDebugAndroidTest'

android {
    compileSdkVersion 27

    defaultConfig {
        applicationId "com.google.firebase.quickstart.database"
        minSdkVersion 16
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.debug
        }
    }
}

configurations.all {
    resolutionStrategy.force 'com.android.support:support-annotations:27.1.1'
}

dependencies {
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'

    implementation 'com.firebaseui:firebase-ui-database:4.0.0'

    implementation 'com.google.android.gms:play-services-auth:15.0.1'

    implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation 'com.google.firebase:firebase-auth:16.0.2'
    implementation 'com.google.firebase:firebase-database:16.0.1'

    // Needed to fix a dependency conflict with FirebaseUI'
    implementation 'android.arch.core:runtime:1.1.1'

    // Needed to fix a dependency conflict with FirebaseUI'
    implementation 'android.arch.core:runtime:1.1.1'

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    androidTestImplementation 'com.android.support.test:rules:1.0.2'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
}

apply plugin: 'com.google.gms.google-services'
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Chayan Mistry
  • 396
  • 3
  • 14

1 Answers1

0

Try to Add below repositories in Top-Level gradle.

google(), mavenLocal() and jcenter()

I was getting same issue and i resolved by adding these.

Wasim Amin
  • 71
  • 1
  • 5
  • Can you explain further how to do this? – Nico Haase Jul 30 '18 at 11:07
  • In your Project's build.gradle file, update class path to classpath 'com.google.gms:google-services:4.0.2' and add allprojects { repositories { google() mavenLocal() jcenter() } } – Wasim Amin Jul 31 '18 at 09:42