Firebase Gradle构建的问题

时间:2018-05-14 18:16:25

标签: android firebase gradle

所以我看了一堆文章,这些文章有解决方案,但没有任何工作。使用带有Google Pay Services位置和地图的Firebase Messaging和Firestore库时出现错误。每当我构建项目时,都会返回以下错误:

  

无虚方法zzbqp()Ljava / lang / String;在班上   LCOM /谷歌/火力/ FirebaseApp;或其超级类(声明   'com.google.firebase.FirebaseApp'出现在   /data/app/skutl.me.client-P4tdXC_WHOrJdSuzHJKp9Q == / base.apk)

以下是我的gradle配置文件:

  

顶级项目文件

buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
        classpath 'com.google.gms:google-services:3.2.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    } }

allprojects {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com" // Google's Maven repository
        }
        google()
    } }

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

应用构建文件

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    buildToolsVersion '27.0.3'
    defaultConfig {
        applicationId "skutl.me.client"
        minSdkVersion 16
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

repositories {
    google()
    jcenter()
    maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
    maven { url "https://maven.google.com" }
}

dependencies {
    implementation 'com.google.android.gms:play-services-location:15.0.1'
    implementation 'com.google.android.gms:play-services-maps:15.0.1'

    implementation 'com.firebaseui:firebase-ui-auth:3.1.3'
    implementation 'com.google.firebase:firebase-messaging:15.0.2'
    implementation 'com.google.firebase:firebase-firestore:16.0.0'

    implementation fileTree(include: ['*.jar'], dir: 'libs')
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    implementation 'com.android.support:design:27.0.2'
    implementation 'com.android.support:support-compat:27.0.2'


    implementation 'com.google.code.gson:gson:2.8.2'
    implementation 'com.android.support:multidex:1.0.1'

    implementation 'com.android.volley:volley:1.1.0'
    implementation 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'
    testImplementation 'junit:junit:4.12'
}

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

我尝试将它们设置为相同级别,但是没有一个库具有相同版本的v15或v16。对这些错误的任何见解?

1 个答案:

答案 0 :(得分:0)

改变这个:

implementation 'com.firebaseui:firebase-ui-auth:3.1.3'

到这个

implementation 'com.firebaseui:firebase-ui-auth:3.3.1'

这是firebase v15的正确版本,请参阅repo

另外,正如@JamesPoang所建议你需要firebase核心:

implementation 'com.google.firebase:firebase-core:15.0.2'