-1
I need to delete a record from Firebase Auth, I am using the following code:
FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
user.delete().addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
}
});
But it’s making a mistake:
java.lang.Nullpointerexception: Attempt to invoke virtual method 'com.google.android.gms.tasks.Task com.google.firebase.auth.Firebaseuser.delete()' on a null Object Reference
Does anyone know what I’m doing wrong or how I delete a record of Firebase Auth?
user
is certainly null. You do not have a user logged in with this instance of Firebaseuth. If you want to delete a specific user and not the connected user himself (like an Administer/superuser) use Firebase Console.– Lennoard Silva
I want to delete the user q is current, for example... after he leaves a login validation page, without having validated using a code that is sent by sms (all ready so far), his user is deleted from the bank, because he has not finished his registration.
– Luis Felipe
Got it. But your Firebaseuth has no users, maybe it hasn’t even been created in the first place.
– Lennoard Silva