Firebase依赖项已正确设置但仍无法解析

时间:2017-03-18 02:31:37

标签: android firebase

firebase新手,但当我尝试使用其电子邮件身份验证指南中所述的private FirebaseAuth mAuth;时,无法解析。我在项目中设置了firebase,它说我已经正确完成了。

我是否需要在该java文件上导入一些内容?

enter image description here

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.3.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.google.firebase:firebase-auth:10.2.0'
    compile 'com.android.support:design:25.3.0'
    testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

1 个答案:

答案 0 :(得分:1)

您需要添加:

import com.google.firebase.auth.FirebaseAuth;

Android Studio将帮助您处理此类未解析的引用。单击未解析的符号,然后输入 Alt + Enter 。将自动添加所需的导入。

相关问题