java - Android Studio - 错误 : cannot find symbol class FirebaseAuth

标签 java android firebase firebase-authentication

我在 Android 中遇到以下错误:

error: cannot find symbol class FirebaseAuth
error: cannot find symbol variable FirebaseAuth
error: cannot find symbol class OnCompleteListener
error: cannot find symbol class AuthResult

我在应用程序中的build.gradle:

implementation 'com.google.firebase:firebase-auth:16.1.0'
implementation 'com.google.firebase:firebase-core:16.0.7'

我的项目中的build.gradle:

classpath 'com.google.gms:google-services:4.1.0'

最佳答案

确保您已在项目级别添加 google maven 存储库 -

allprojects {
    // ...
    repositories {
        google() // Google's Maven repository
        // ...
    }
}

并且,在应用程序级 gradle 文件的底部添加此行 -

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

如果仍然出现错误,请将 Google 服务版本更改为

classpath 'com.google.gms:google-services:4.2.0'

有关详细信息,请访问 Firebase documentation .

关于java - Android Studio - 错误 : cannot find symbol class FirebaseAuth,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54916722/

相关文章:

java - LocalDateTime isAfter 和 isBefore 配置时间

Java 8 lambda 表达式 : Group all items in sequence which satisfy the given predicate. 分组应将谓词作为键,将项作为值

java - Android 与 Java 更新

android - phonegap/Cordova 错误 : [RangeError: Maximum call stack size exceeded]

java - Android 预处理器

firebase - cordova-plugin-fcm 使用 ios 真实设备( ionic )在 token 中给出 null

JavaFX 代码重复

Android获取系统语言环境的不同方法

ios - 它抛出这个错误 : Value of type 'StorageMetadata' has no member 'downloadURL'

ios - 如何从最新到最旧的顺序从 Firebase 获取图像?