title: Unable to add data to Firebase in Android (Rules set to true)
body: <p>I'm new to Firebase. </p>
  
  <p>I am trying to add a Title and some Text to my Firebase Database. I've set the Rules for write and read to true.<br>
  <strong>Edit:</strong><br>
  Copy pasted this exact same code to another Android Studio project and set up a new Firebase project and ran this <strong>exact same code on my phone.</strong> It added data to the Firebase database.
  I don't know if I should be happy or sad it did.</p>
  
  <p>This is the class from which data is to be sent:</p>
  
  <pre><code>public class CreateActivity extends AppCompatActivity {
  
      FirebaseDatabase mFirebaseDatabase;
      DatabaseReference mDatabaseReference;
      EditText titleText;
      EditText postText;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_create);
          Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
          setSupportActionBar(toolbar);
          getSupportActionBar().setDisplayHomeAsUpEnabled(true);
          setTitle("");
          titleText = (EditText) findViewById(R.id.create_title);
          postText = (EditText) findViewById(R.id.create_text);
          mFirebaseDatabase = FirebaseDatabase.getInstance();
          mDatabaseReference = mFirebaseDatabase.getReference().child("PostsText");
  
          Button postButton = (Button) findViewById(R.id.create_button);
  
          postButton.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
  
                  if(titleText!=null &amp;&amp; postText!=null ) {
                      TextPost textPost = new TextPost(titleText.getText().toString(),postText.getText().toString());
                      mDatabaseReference.push().setValue(textPost).addOnCompleteListener(new OnCompleteListener&lt;Void&gt;()
                      {
                          @Override
                          public void onComplete(@NonNull Task&lt;Void&gt; task) {
                              if(task.isSuccessful()){
                                  Toast.makeText(CreateActivity.this,"Yes!",Toast.LENGTH_SHORT).show();
                              }
                              else
                              {
                                  Toast.makeText(CreateActivity.this,"No!",Toast.LENGTH_SHORT).show();
                              }
                          }
                      });
                      titleText.setText("");
                      postText.setText("");
                      Toast.makeText(CreateActivity.this,"Post uploaded!",Toast.LENGTH_SHORT).show();
                  }
  
                  else
                  {
                      Toast.makeText(CreateActivity.this,"Empty fields!",Toast.LENGTH_SHORT).show();
                  }
              }
          });
      }
  }
  </code></pre>
  
  <p>This is the TextPost class whose object I am pushing into the Firebase Database:</p>
  
  <pre><code>public class TextPost {
      String title;
      String text;
  
      public TextPost() {
      }
  
      public TextPost(String title, String text) {
          this.title = title;
          this.text = text;
      }
  
      public String getTitle() {
          return title;
      }
  
      public String getText() {
          return text;
      }
  }
  </code></pre>
  
  <p>When I run the CreateActivity and press "Post", the toast pops up saying "Post uploaded", but my Firebase Database in the console still reads "null".
  <strong>Also, a toast saying "Yes!" or "No!" does NOT pop up!</strong></p>
  
  <p><strong>I have also added the google-services.json file to my app folder.</strong></p>
  
  <p>Here's my logs after opening the CreateActivity, typing in the Title and Text and clicking on Post:</p>
  
  <pre><code>06-27 00:45:09.323 24528-24528/com.android.example.prototype I/ViewRootImpl: finishMotionEvent: handled = true stage=10: View Post IME stage,inputElapseTime=12 eventTime = 648344822 downTime = 648344822 title= com.android.example.prototype/com.android.example.prototype.CreateActivity
  06-27 00:45:10.850 24528-24553/com.android.example.prototype W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
  06-27 00:45:12.737 24528-24528/com.android.example.prototype I/ViewRootImpl: finishMotionEvent: handled = true stage=10: View Post IME stage,inputElapseTime=13 eventTime = 648348239 downTime = 648348239 title= com.android.example.prototype/com.android.example.prototype.CreateActivity
  </code></pre>
  
  <p>Can someone please help me figure this one out?
  Let me know if you need any more info.</p>
  
  <p>My build.gradle dependencies are:</p>
  
  <pre><code>compile 'com.android.support:appcompat-v7:25.3.1'
  compile 'com.android.support.constraint:constraint-layout:1.0.2'
  compile 'com.android.support:design:25.3.1'
  compile 'com.android.support:cardview-v7:25.3.1'
  compile 'com.android.support:recyclerview-v7:25.3.1'
  compile 'com.daprlabs.aaron:swipedeck:2.0.6'
  compile 'com.squareup.picasso:picasso:2.5.2'
  compile 'com.android.support:support-v4:25.3.1'
  compile 'me.grantland:autofittextview:0.2.+'
  compile 'com.android.support:multidex:1.0.1'
  compile 'com.google.firebase:firebase-auth:10.0.1'
  compile 'com.google.firebase:firebase-core:10.0.1'
  compile 'com.google.firebase:firebase-database:10.0.1'
  testCompile 'junit:junit:4.12'
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/IAXVF.jpg" rel="nofollow noreferrer">This is my debug screen after getting a Database reference</a></p>
  
  <p>The debugger skips the addOnCompleteListener method completely and goes directly to setting the titleText and postText to blank.
  Any ideas what I should try digging into further or any particular variables that I should look into? </p>