FirebaseUser
昨天还运行得很好,但今天早上我打开项目时发现,Firebase类现在没有任何对Firebase类的引用。我找不到getCurrentUser()
方法。
不过,类中的Google doc still shows that it exists!
我在那个类中的imports
:
import com.google.firebase.auth.AuthCredential;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.auth.GetTokenResult;
import com.google.firebase.auth.GoogleAuthProvider;
The build.gradle
api 'com.google.firebase:firebase-auth:16.0.2'
implementation 'com.firebaseui:firebase-ui-auth:4.1.0'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation 'com.google.firebase:firebase-admin:6.3.0'
而且是的:
我在我的build.gradle
build.gradle
中有apply plugin: 'com.google.gms.google-services'
has repositories { google() jcenter() }
in it
Clean
我的项目没有出现错误<>H121我已经重新启动了code
我的应用程序中当前的错误(似乎从昨天开始就突然出现了):
getCurrentUser()
方法在我的FirebaseAuth
类(已导入)中不再存在。它的signInWithCredential(...)
、signOut()
、createUserWithEmailAndPassword(...)
和signInWithEmailAndPassword(...)
方法也是如此。isEmailVerified()
方法不再存在于我的FirebaseUser
类中<>H138当尝试Make Project
时,我收到此错误:现在突出显示为错误D44
我的完整build.gradle
:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.payne.simpletestapp"
minSdkVersion 16
targetSdkVersion 27
multiDexEnabled true
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:support-vector-drawable:27.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
api 'com.google.firebase:firebase-auth:16.0.2'
implementation 'com.firebaseui:firebase-ui-auth:4.1.0'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation 'com.google.firebase:firebase-admin:6.3.0'
implementation 'org.osmdroid:osmdroid-android:6.0.1'
implementation 'org.osmdroid:osmdroid-wms:6.0.1'
implementation 'org.osmdroid:osmdroid-mapsforge:6.0.1'
implementation 'org.osmdroid:osmdroid-geopackage:6.0.1'
api 'com.github.MKergall:osmbonuspack:6.5.1'
implementation 'org.springframework.android:spring-android-rest-template:2.0.0.M3'
api 'org.apache.httpcomponents:httpclient-android:4.3.5'
implementation 'com.squareup.picasso:picasso:2.71828'
// https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind
implementation 'com.fasterxml.jackson.core:jackson-databind:2.9.6'
}
repositories {
maven {
url 'https://repo.spring.io/libs-milestone'
}
}
apply plugin: 'com.google.gms.google-services'
请帮帮忙?我花了几天的时间构建这个类,现在它不能工作了。
发布于 2018-09-04 15:29:56
从build.gradle
中删除firebase-admin
并按Sync now
键解决了问题!
感谢BobSnyder (在评论中)。
发布于 2018-07-20 04:29:17
该方法仍然存在。Android Studio可能搞混了,可能是因为你的项目.idea文件夹中的某些东西被破坏了。
尝试退出Android Studio,删除项目根目录下的.idea文件夹,然后再次将项目导入Android Studio。
发布于 2018-07-20 04:55:22
转到File
-> Invalidate caches and restart
菜单。
https://stackoverflow.com/questions/51431194
复制相似问题