How to remove duplication of files Android Studio

I was building a project on Android Studio Using Firebase. Finished and when I compiled, following error arrived. I read other answers on stack regards this but cannot get what wrong I am doing. I am new to Android Studio

Below is my app/build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.0"
    defaultConfig {
        applicationId "com.example.root.dravis"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    //adding firebase dependencies manually
   compile 'com.android.support:appcompat-v7:25.0.0'
   compile 'com.android.support:design:25.0.0'
    compile 'com.google.firebase:firebase-database:9.8.00'
    testCompile 'junit:junit:4.12'
    compile 'com.firebase:firebase-client-android:2.5.2'
}

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

following is my errorCompile Time error Snap

Upvotes: 1

Views: 96

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 599946

You're combining two different, incompatible version of the Firebase SDK:

compile 'com.google.firebase:firebase-database:9.8.00'
compile 'com.firebase:firebase-client-android:2.5.2'

You should only be using the latest version: 9.8.0.

compile 'com.google.firebase:firebase-database:9.8.0'

For more information on getting started with this latest Firebase in Android, see the documentation here: https://firebase.google.com/docs/android/setup

Upvotes: 1

Related Questions