0

The following two lines keep crashing my code. I am trying to access information from the firebase database but it keeps crashing. I have verified the Json file and it is the latest. This is the error i am getting.

Caused by: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process "projectname" Make sure to call FirebaseApp.initializeApp(Context) first.

//       FirebaseApp.initializeApp(this);
//      mSoftwareDatabase = FirebaseDatabase.getInstance().getReference("Software");
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • 2
    If you search that error message, you will find a lot of posts on Stack Overflow that say the same thing. Have you read any of those? The problem is typically that you didn't follow the integration instructions completely. – Doug Stevenson Feb 24 '19 at 02:51
  • yes read a lot of them, many different opinions none are helping –  Feb 24 '19 at 03:31
  • If you don't say exactly how to duplicate this problem, starting from scratch, then you will probably just get the same responses, or people will vote to close. – Doug Stevenson Feb 24 '19 at 03:39
  • The code looks fine, at least as long as you've uncommented the first line. Most folks seem to have this problem due to a mistake in their build file as shown here: https://stackoverflow.com/a/40085096/209103. If that is not the cause for you, update your question to include the [minimal information that is needed to reproduce the problem](http://stackoverflow.com/help/mcve). – Frank van Puffelen Feb 24 '19 at 04:39

0 Answers0