Firebase Android Studio(2.2.3)问题

时间:2017-04-23 03:17:03

标签: android firebase firebase-realtime-database firebase-storage

我在Android项目中编译Firebase时遇到问题。这是我的应用程序级别gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "24.0.3"
    defaultConfig {
        applicationId "<my_app_id>"
        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'
    })
    compile 'com.android.support:appcompat-v7:25.1.0'
    compile 'com.android.support:support-v4:25.1.0'
    compile 'com.google.android.gms:play-services-auth:10.0.1'
    compile 'com.android.support:design:23.0.1'
    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'me.relex:circleindicator:1.2.2@aar'
    compile 'com.android.support:recyclerview-v7:25.1.0'
    compile 'com.google.firebase:firebase-core:10.2.1'
    testCompile 'junit:junit:4.12'
}

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

这是构建gradle:

    buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'
        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
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

我收到无法解决的错误:com.google.firebase:firebase-core:10.2.1

3 个答案:

答案 0 :(得分:2)

如果您使用的是android studio,

转到工具 - &gt; Firebase

按照屏幕说明操作。 Android工作室负责处理依赖问题。

答案 1 :(得分:0)

更改

compile 'com.google.android.gms:play-services-auth:10.2.1'

compile 'com.google.android.gms:play-services-auth:10.0.1'

它对我有用。

答案 2 :(得分:0)

更新播放服务版本并更新firebase依赖关系版本。