【问题标题】:How to resolve firebase build faild error?如何解决firebase构建失败错误?
【发布时间】:2019-07-10 08:04:13
【问题描述】:

我尝试使用 firebase 制作一个聊天应用程序,但是当我尝试在模拟器上运行该应用程序时,我得到这个“错误:com.google.firebase.FirebaseApp$zza 类型被引用为来自com.google.android.gms.internal.zzbkv$3 的接口。”

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

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.firebasechat"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0-alpha02'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.firebase:firebase-core:16.0.7'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.2-alpha01'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.2-alpha01'

    implementation 'com.google.android.material:material:1.1.0-alpha03'
    implementation 'com.firebaseui:firebase-ui:1.1.1'
    implementation 'com.google.firebase:firebase-auth:16.1.0'
    implementation 'com.google.android.gms:play-services-auth:16.0.1'

    implementation 'com.jakewharton:butterknife:10.1.0'
    annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0'
}

【问题讨论】:

    标签: java android firebase gradle


    【解决方案1】:

    应用插件:'com.google.gms.google-services'

    类路径'com.google.gms:google-services:4.0.1'

    检查 gradle 模块中的声明插件。并定义项目 gradle 的类路径

    【讨论】:

    • 插件已应用并且项目 gradle 文件的类路径是类路径 'com.google.gms:google-services:4.2.0'
    猜你喜欢
    • 2019-03-26
    • 1970-01-01
    • 2021-05-07
    • 2020-11-02
    • 2021-11-27
    • 1970-01-01
    • 2014-02-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多