android - 无法解析 : com. firebase :firebase-client-android:2. 3.1

标签 android firebase android-gradle-plugin

我正在处理下面博客中的示例

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

项目添加依赖后编译失败

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

其他依赖编译没有任何问题。

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

我哪里错了?

这是我的模块 build.gradle

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'
}

顶级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
}

最佳答案

项目编译失败,因为版本 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

关于android - 无法解析 : com. firebase :firebase-client-android:2. 3.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33104234/

相关文章:

android - 更新支持库的最佳方式

Android play 商店评论通知

android - 使用 Firebase 时防止内存泄漏的最佳方法

iOS - 如何禁用 Firebase 缓存?

android - Gradle 同步已完成,但出现一些错误

android - 如何将外部Java类复制到build.gradle中的生成源中?

android - 当应用程序从后台终止时从状态栏中删除通知

android - 更新Android Studio后,没有支持库下载

android - 互联网可用时如何处理自动消失对话框 fragment ?

reactjs - 警告 : It looks like you're using the development build of the Firebase JS SDK