0

What I'm trying to write is

private FireBaseAuth mAuth;

but it keeps on saying can't resolve my 'FirebsaeAuth' symbol. What I'm trying to make is a budgeting app by the way if that helps

This is my code :

package com.example.budgetingapp;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;



public class registration extends AppCompatActivity {

    private EditText mEmail ;
    private EditText mPass ;
    private EditText btnReg ;
    private EditText mSignin ;

    //Firebase...

    private FireBaseAuth mAuth;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_registration);

        mAuth=FirebaseAuth.getInstance();

        registration();
    }

    private void registration() {

        mEmail=findViewById(R.id.email_signup);
        mPass=findViewById(R.id.password_signup);
        btnReg=findViewById(R.id.btn_signup);
        mSignin=findViewById(R.id.sign_in);

        btnReg.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String email=mEmail.getText().toString().trim();
                String pass=mPass.getText().toString().trim();

                if (TextUtils.isEmpty(email)){
                    mEmail.setError("Email Required...");
                    return;
                }
                if (TextUtils.isEmpty(pass)){
                    mPass.setError("Password Required...");
                    return;
                }

            }
        });

        mSignin.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(getApplicationContext(),MainActivity.class));

            }
        });
    }

}

my dependacies

dependencies {

    implementation("androidx.appcompat:appcompat:1.6.1")
    implementation("com.google.android.material:material:1.9.0")
    implementation("androidx.constraintlayout:constraintlayout:2.1.4")
    testImplementation("junit:junit:4.13.2")
    androidTestImplementation("androidx.test.ext:junit:1.1.5")
    androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
    implementation(platform("com.google.firebase:firebase-bom:32.2.3"))
    implementation("com.google.firebase:firebase-analytics")
    implementation ("com.google.firebase:firebase-auth:32.2.3")
    implementation ("com.google.android.gms:play-services-gcm:32.2.3")

What I've tried :

1. adding these two implementations

implementation ("com.google.firebase:firebase-auth:32.2.3")
implementation ("com.google.android.gms:play-services-gcm:32.2.3")

2.Clean

3. i've checked out

Cannot resolve symbol 'FirebaseAuth'

  • In addition to the type that Ryanhtech identified in their answer, you're missing an `import` statement for `FirebaseAuth`. If you follow the link to `EmailPasswordActivity.java` from the documentation on [getting started with Firebase Authentication on Android]( Firebase), you'll find all that you need. – Frank van Puffelen Aug 27 '23 at 18:19
  • Have you tried Frank's suggestion? Does it work for you? – Alex Mamo Aug 28 '23 at 06:54
  • yup worked wonders – Nabil Aiman Aug 28 '23 at 08:15

1 Answers1

1

Replace FireBaseAuth by FirebaseAuth, it should work.

Ryanhtech
  • 15
  • 5
  • i tried changing it still gave the same results Cannot resolve symbol 'FirebaseAuth' and FirebaseAuth is highlighted in red – Nabil Aiman Aug 27 '23 at 17:34