Failed to solve: com.firebase: firebase-client-android: 2.3.1

I am working on a sample blog below

https://www.firebase.com/blog/2015-10-01-firebase-android-app-engine-tutorial.html

Projects do not compile after adding a dependency

compile 'com.firebase:firebase-client-android:2.3.1'

Other dependencies compile without problems.

'com.android.support:appcompat-v7:23.0.1'
'compile 'com.android.support:design:23.0.1'

Where am I going wrong?

here is my build.gradle module

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

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

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

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
//    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile 'com.android.support:design:23.0.1'
    compile 'com.firebase:firebase-client-android:2.4.0'
}

Top level gradle

// 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:1.3.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
}
+5
source share
9 answers

We are talking about Google api versions without mentioning the Google Repository . The real problem is that your Google repository does not “know” about the version of firebase that you all tried to use.

, firebase

build.gradle :

apply plugin: 'com.android.application'
android {
  // ...
}

dependencies {
  // ...
  compile 'com.google.firebase:firebase-core:10.2.1'
  compile 'com.google.firebase:firebase-messaging:10.2.1'

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

Google Repository 44

SDK Manager > Android SDK > SDK ()

- 46 ( )

Google , !

, " Google" " SDK" "", Google .

Google, , firebase api version slighlty. build.gradle :

apply plugin: 'com.android.application'
android {
  // ...
}

dependencies {
  // ...
  compile 'com.google.firebase:firebase-core:10.2.0'
  compile 'com.google.firebase:firebase-messaging:10.2.0'

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

firebase 10.2.0 10.2.1

, 10.2.0 Google 44.

, .

+3

, 2.3 . 2.3.1:

compile 'com.firebase:firebase-client-android:2.3.1'

2.4.0:

compile 'com.firebase:firebase-client-android:2.4.0'

:
https://www.firebase.com/docs/android/quickstart.html

+2

, firebase:

  • android: " Firebase", , 2.3.1 Android.

  • - 2.4 , , . , jvm, "android" . compile 'com.firebase: firebase-client-android: 2.4.0'

+1

,

compile 'com.firebase:firebase-client-android:2.3'

.

:

compile 'com.firebase:firebase-client-android:2.4.0'
compile 'com.firebase:firebase-client-android:2.3.1'
compile 'com.firebase:firebase-client-android:2.3.0'

.

compile 'com.firebase:firebase-client-android:2.3.0'

compile 'com.firebase:firebase-client-android:2.3'

maven:

+1

compile 'com.firebase:firebase-client-android:+'

.

+1

, 2.4.1. l jenter.bintray.com/com/firebase/firebase-client-android/2.4.1/, .

: VPN, .

0

, dex. Firebase SDK, , , , multiDexEnabled true defaultConfig : build.gradle, '. android.support:multidex:1.0.0 '

gradle

gradle

// 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:1.5.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
}

gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.tranetech.openspace.firebasedemo"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        packagingOptions {
            exclude 'META-INF/LICENSE'
            exclude 'META-INF/LICENSE-FIREBASE.txt'
            exclude 'META-INF/NOTICE'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.2.1'
    compile 'com.firebase:firebase-client-android:2.5.2+'
    compile 'com.firebaseui:firebase-ui:0.3.1'
    compile 'com.android.support:multidex:1.0.0'
}
0

, , , -

build.gradle( )

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        ////
        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
    }
}

build.gradle

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.+'
    compile 'com.android.support:design:23.+'
    compile 'com.google.firebase:firebase-core:9.2.1'
    compile 'com.google.firebase:firebase-database:9.2.1'
    compile 'com.firebase:firebase-client-android:2.4.0'
}

:

'com.google.gms.google-services'// <- this code

And finally, do not forget to download google-services.json in the application folder, the path should look like \ yourapplication \ app, you can also link to this link to download google-services.json . Download configuration file

0
source

compilation is out of date. You should use:

implementation 'com.firebase:firebase-client-android:2.5.2'
0
source

Source: https://habr.com/ru/post/1611438/


All Articles