0

I was working on SignUpActivity.

I have worked on this before but I did not get this type of error.

This is my Sign up Activity:

public class SignUpActivity extends AppCompatActivity {

    ActivitySignUpBinding binding;
    private FirebaseFirestore firestore;
    private FirebaseAuth auth;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding = ActivitySignUpBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());

        //I erased the methods and more codes and I just keep it simple for you to understand the code. 
        //but if you run this code then it will give you an error.

        //main error this below code giving
        auth = FirebaseAuth.getInstance();
        firestore = FirebaseFirestore.getInstance();
     }
}

This is my logcat:

E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.vishal.kaitka.openqadmin, PID: 7293
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.app.myapp/com.example.app.myapp.SignUpActivity}: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process com.example.app.myapp. Make sure to call FirebaseApp.initializeApp(Context) first.
Turing85
  • 18,217
  • 7
  • 33
  • 58
Vishal
  • 1
  • 1

0 Answers0