title: Firebase database authentication sign-up
body: <p>I'm connecting my app to database with authentication using email and password in signing in users, the whole code is alright and has no errors until to running the app where the sign registration fails, help
  Heres my code for App gradle</p>
  
  <pre><code>"apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 28
      defaultConfig {
          applicationId "com.gmail.yobimwaura.talktome"
          minSdkVersion 19
          targetSdkVersion 28
          versionCode 1
          versionName "1.0"
          testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  configurations {
      // Initializes a placeholder for the freeDebugRuntimeOnly dependency
      // configuration.
      freeDebugRuntimeOnly {}
  }
  
  dependencies {
      implementation fileTree(dir: 'libs', include: ['*.jar'])
      implementation 'com.android.support:appcompat-v7:28.0.0'
      implementation 'com.android.support.constraint:constraint-layout:1.1.3'
      implementation 'com.google.firebase:firebase-core:16.0.5'
      testImplementation 'junit:junit:4.12'
      androidTestImplementation 'com.android.support.test:runner:1.0.2'
      androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
      implementation 'com.android.support:design:28.0.0'
      implementation 'com.google.firebase:firebase-auth:16.0.5'
  }
  apply plugin: 'com.google.gms.google-services'"
  </code></pre>
  
  <p>Sign in activity java file</p>
  
  <pre><code>"package com.gmail.yobimwaura.talktome;
  
  import android.content.Intent;
  import android.net.Uri;
  import android.support.annotation.NonNull;
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.util.Log;
  import android.view.View;
  import android.widget.Button;
  import android.widget.EditText;
  import android.widget.TextView;
  import android.widget.Toast;
  
  import com.google.android.gms.tasks.OnCompleteListener;
  import com.google.android.gms.tasks.Task;
  import com.google.firebase.auth.AuthResult;
  import com.google.firebase.auth.FirebaseAuth;
  import com.google.firebase.auth.FirebaseAuthException;
  import com.google.firebase.auth.FirebaseUser;
  
  
  public class signup extends AppCompatActivity {
  FirebaseAuth firebaseAut;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.signup);
  
  
          firebaseAut = FirebaseAuth.getInstance();
  
          TextView textView2 = (TextView) findViewById(R.id.textView2);
          textView2.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  Intent intent = new Intent(signup.this, login.class);
                  startActivity(intent);
              }
          });
  
          Button button5 = (Button) findViewById(R.id.button5);
          button5.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  finish();
              }
          });
  
          Button button4 = (Button) findViewById(R.id.button4);
          button4.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  if (validate()) {
                      //upload data to database
                      EditText editText3 = (EditText) findViewById(R.id.editText3);
                      EditText editText4 = (EditText) findViewById(R.id.editText4);
  
                      String Email = editText3.getText().toString().trim();
                      String Password = editText4.getText().toString().trim();
  
                      firebaseAut.createUserWithEmailAndPassword(Email,Password).addOnCompleteListener(new OnCompleteListener&lt;AuthResult&gt;() {
                          @Override
                          public void onComplete(@NonNull Task&lt;AuthResult&gt; task) {
                              if (task.isSuccessful()) {
                                  Toast.makeText(signup.this, "Registration Successful", Toast.LENGTH_SHORT).show();
                                  startActivity(new Intent(signup.this, login.class));
                              } else {
                                  Toast.makeText(signup.this, "Registration Fail", Toast.LENGTH_SHORT).show();
                              }
  
                          }
                      });
  
                  }
              }
          });
      }
      private Boolean validate () {
          Boolean result =false;
          EditText editText3= (EditText) findViewById(R.id.editText3);
          EditText editText4= (EditText) findViewById(R.id.editText4);
          String Email=editText3.getText().toString();
          String Password=editText4.getText().toString();
  
          if(Email.isEmpty() || Password.isEmpty() ) {
              Toast.makeText(this, "Fill details to continue", Toast.LENGTH_SHORT).show();
          }else{
              result=true;
  
          }
          return result;
  
      }
  }"
  </code></pre>
  
  <p>If you need any other code ask for it, once I press the sign-in button 4 it displays 'registration failed' yet the empty textbox tag is working once clicked, my app has successfully connected to the database firebase</p>