FireBase错误:无法访问未找到com.google.android.gms.internal.zzanb的zzanb类文件 [英] FireBase Error: cannot access zzanb class file for com.google.android.gms.internal.zzanb not found

查看:123
本文介绍了FireBase错误:无法访问未找到com.google.android.gms.internal.zzanb的zzanb类文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

UPD .我已经阅读了以下问答(​​ Class文件找不到com.google.android.gms.internal.zzaja ).但是我不明白我需要在项目中添加或删除哪些字符串.因为我的代码中没有此字符串和其他字符串,所以:编译'com.google.android.gms:play-services-location:9.2.0'

UPD. I have read these question and answer (Class file for com.google.android.gms.internal.zzaja not found). But I doesnt understand what strings i need to add or remove in my project. Because I havent this and other strings in my code: compile 'com.google.android.gms:play-services-location:9.2.0'

我使用FireBase开发了一个Android应用程序.而当我要构建我的项目时,我会遇到一个错误:

I develop an android app with use of FireBase. And when I want to build my project I have an error:

错误:(39,25)错误:无法访问zzanb找不到com.google.android.gms.internal.zzanb的类文件

Error:(39, 25) error: cannot access zzanb class file for com.google.android.gms.internal.zzanb not found

该错误是由于调用以下语句引起的: FirebaseAuth.getInstance().getCurrentUser();

The error was caused by invoking statement: FirebaseAuth.getInstance().getCurrentUser();

项目build.gradle:

Projects build.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:2.2.3'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:3.0.0'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

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

模块build.gradle:

Modules build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    defaultConfig {
        applicationId "xxx.yyy.zzz"
        minSdkVersion 19
        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(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:25.1.0'
    compile 'com.google.firebase:firebase-core:10.0.1'
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:design:25.1.0'
    compile 'com.firebaseui:firebase-ui:0.6.0'
    compile 'com.android.support.test.espresso:espresso-core:2.2.2'
}

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

请帮助我解决该错误)

PS我已经阅读了该问题(

P.S I have already read that question (Firebase Error cannot access zzanb after using play-services-xxx:9.8.00), but i didnt understand anything, what i need to add or remove from my build.gradle files in my situation.

推荐答案

您正在混合来自新旧Firebase发布的库.您使用的Firebase中的所有内容均应处于同等状态.此行引用了一个非常老的Firebase版本中的库(在它成为Google的Firebase平台之前):

You're mixing libraries from old and new Firebase released. Everything from Firebase that you use should be in parity. This line is reference an library from a very old Firebase release (before it became the Firebase platform at Google):

compile 'com.firebaseui:firebase-ui:0.6.0'

如果您要使用Firebase-UI库,则应使用它的新版本.您正在使用10.0.1,所以根据我刚刚链接的Firebase-UI github上的表,您需要此依赖项:

If you want to use the Firebase-UI library, you should use the new version of it that matches the version of the main client library you're using. You're using 10.0.1, so according to the table on the Firebase-UI github I just linked, you want this dependency:

compile 'com.firebaseui:firebase-ui:1.1.1'

始终确保您的Firebase-UI库与您使用的核心Firebase SDK相匹配.

Always make sure your Firebase-UI library matches the core Firebase SDK you're using.

这篇关于FireBase错误:无法访问未找到com.google.android.gms.internal.zzanb的zzanb类文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆