Problem with Firebasepp call

Asked

Viewed 45 times

0

I have a fragment that performs user registration and login using Firebase. However, I’m having trouble with the initializeApp(Context) method. Follows the code:

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    rootView = inflater.inflate(R.layout.fragment_perfil, container, false);

    FirebaseApp.initializeApp(getContext());
    mAuth = FirebaseAuth.getInstance();

the error message:

Default Firebasepp is not initialized in this process com.redentor.Mikha.scientia. Make sure to call Firebasepp.initializeApp(Context) first. at com.google.firebase.FirebaseApp.getInstance(Unknown Source)

  • You can post your grandle ?

1 answer

0

First of all try to see if you have any update of the firebase API, and in the code remove:

FirebaseApp.initializeApp(getContext());
mAuth = FirebaseAuth.getInstance();

And add just one:

FirebaseDatabase fbDatabase = FirebaseDatabase.getInstance();

Browser other questions tagged

You are not signed in. Login or sign up in order to post.