title: Firebase "no such instance field" error
body: <p>As the title says, I have encountered that error when I tried working with Firebase database. I have tried numerous solutions found online but nothing seems to have worked for me. Below you can find my code and also, a brief information regarding on what I've tried so far before posting on stackOverflow.</p>
  <p>The code is the following:</p>
  <pre><code>package com.example.vlad.restaurantorder;
  
  import android.app.ProgressDialog;
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.Button;
  import android.widget.EditText;
  import android.widget.Toast;
  
  import com.example.vlad.restaurantorder.Model.User;
  import com.google.firebase.database.DataSnapshot;
  import com.google.firebase.database.DatabaseError;
  import com.google.firebase.database.DatabaseReference;
  import com.google.firebase.database.FirebaseDatabase;
  import com.google.firebase.database.ValueEventListener;
  import com.rengwuxian.materialedittext.MaterialEditText;
  
  public class LogIn extends AppCompatActivity {
      EditText editPhone, editPassword;
      Button btnLogIn;
      FirebaseDatabase database;
      DatabaseReference tableUser;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_log_in);
  
      btnLogIn = (Button)findViewById(R.id.btnLogInScreenLogIn);
      editPhone = (MaterialEditText)findViewById(R.id.edtPhone);
      editPassword = (MaterialEditText)findViewById(R.id.edtPassword);
  
      //database
      database = FirebaseDatabase.getInstance();
      tableUser = database.getReference(&quot;User&quot;);
  
      btnLogIn.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
  
              final ProgressDialog progressDialog = new ProgressDialog(LogIn.this);
              progressDialog.setMessage(&quot;Please wait...&quot;);
              progressDialog.show();
  
              tableUser.addValueEventListener(new ValueEventListener() {
  
                  @Override
                  public void onDataChange(DataSnapshot dataSnapshot) {
  
                      if(dataSnapshot.child(editPhone.getText().toString()).exists()){
                          progressDialog.dismiss();
                          User user = dataSnapshot.child(editPhone.getText().toString()).getValue(User.class);
                          if(user.getPassword().equals(editPassword.getText().toString())){
  
                              Toast.makeText(getApplicationContext(), &quot;You are logged in!&quot;, Toast.LENGTH_SHORT).show();
                          }
                          else{
  
                              Toast.makeText(getApplicationContext(), &quot;Log in failed!&quot;, Toast.LENGTH_SHORT).show();
                          }
                      }
                      else {
                          progressDialog.dismiss();
                          Toast.makeText(getApplicationContext(), &quot;User does not exists!&quot;, Toast.LENGTH_SHORT).show();
                      }
  
                  }
  
                  @Override
                  public void onCancelled(DatabaseError databaseError) {
  
                  }
              });
          }
      });
  
  
  }
  </code></pre>
  <p>}</p>
  <p>What I have tried so far before posting here: Disabling proGuard and putting minifyEnable on false in build.gradle in debug{}; Restarting android studio, as I've read other people's posts who also encountered the problem said that this worked for them; On line where I used <code>tableUser = database.getReference(&quot;User&quot;);</code> I also tried using <code>tableUser = database.getReference().child(&quot;User&quot;);</code></p>
  <p>Any help is much appreciated. Thank you very much</p>
  <p>Later edit: adding the LogIn activity xml:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;RelativeLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
  xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
  xmlns:tools=&quot;http://schemas.android.com/tools&quot;
  android:layout_width=&quot;match_parent&quot;
  android:layout_height=&quot;match_parent&quot;
  android:background=&quot;@drawable/login_screen_image&quot;
  tools:context=&quot;com.example.vlad.restaurantorder.LogIn&quot;&gt;
  
  
  &lt;LinearLayout
      android:orientation=&quot;vertical&quot;
      android:layout_marginLeft=&quot;8dp&quot;
      android:layout_marginRight=&quot;8dp&quot;
      android:layout_centerInParent=&quot;true&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;wrap_content&quot;&gt;
  
      &lt;com.rengwuxian.materialedittext.MaterialEditText
          android:id=&quot;@+id/edtPhone&quot;
          android:hint=&quot;Phone Number&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:textColorHint=&quot;@android:color/white&quot;
          android:text=&quot;0293292442&quot;
          android:textColor=&quot;@android:color/white&quot;
          android:textSize=&quot;34sp&quot;
          android:inputType=&quot;phone&quot;
          app:met_floatingLabel=&quot;highlight&quot;
          app:met_baseColor=&quot;@android:color/white&quot;
          app:met_maxCharacters=&quot;11&quot;
          app:met_primaryColor=&quot;@android:color/white&quot;
          app:met_singleLineEllipsis=&quot;true&quot;
          /&gt;
  
      &lt;com.rengwuxian.materialedittext.MaterialEditText
          android:id=&quot;@+id/edtPassword&quot;
          android:hint=&quot;Password&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:textColorHint=&quot;@android:color/white&quot;
          android:text=&quot;5678&quot;
          android:textColor=&quot;@android:color/white&quot;
          android:textSize=&quot;34sp&quot;
          android:inputType=&quot;textPassword&quot;
          app:met_floatingLabel=&quot;highlight&quot;
          app:met_baseColor=&quot;@android:color/white&quot;
          app:met_maxCharacters=&quot;11&quot;
          app:met_primaryColor=&quot;@android:color/white&quot;
          app:met_singleLineEllipsis=&quot;true&quot;
          /&gt;
  
  &lt;/LinearLayout&gt;
  
  &lt;info.hoang8f.widget.FButton
      android:id=&quot;@+id/btnLogInScreenLogIn&quot;
      android:text=&quot;@string/LogIn&quot;
      android:textColor=&quot;@android:color/white&quot;
      android:layout_marginRight=&quot;8dp&quot;
      android:layout_marginLeft=&quot;8dp&quot;
      android:layout_alignParentBottom=&quot;true&quot;
      android:layout_weight=&quot;1&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;wrap_content&quot;
      android:layout_margin=&quot;8dp&quot;
      app:buttonColor=&quot;@color/btnLogIn&quot;
      app:shadowColor=&quot;@android:color/black&quot;
      app:shadowEnabled=&quot;true&quot;
      app:shadowHeight=&quot;5dp&quot;
      app:cornerRadius=&quot;4dp&quot;
      /&gt;
  </code></pre>
  
  <p>Later edit: LogCat image:</p>
  <p><a href="https://i.stack.imgur.com/IxCHN.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IxCHN.jpg" alt="enter image description here" /></a></p>