Hello to all! I have been Using google firebase with my android apps for more than 2 years. Today while developing a new app I am facing a weird problem. I set up my firebase project on Google firebase Console successfully. I write the code to push data on firebase successfully.
But the problem is that No data inserted in firebase and no Error occures in the console. I searched online a lot but all in vain. I am pasting Screen shot of my firebase console,database rules and my source code. Kindly guide me.

rules_shot.PNG

firebaseshot.PNG

database = FirebaseDatabase.getInstance();
dealer_ref = database.getReference("reg_requests");

       btnSignup.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                       Dealer dealer = new Dealer();

                        dealer.setId(ed.getText().toString());
                        dealer.setMac(getMacAddress(LoginActivity.this));
                        dealer.setRegistered("no");

                        String id =    dealer_ref.push().getKey();

                         dealer_ref.push().setValue(dealer);

                }
            });

Dani AI

Generated

A quick, practical diagnosis and checklist — based on the snippet and replies by and .

The most likely bug is generating a push key and then calling push() again to write. Calling push() twice creates two different child keys: the generated key never gets written into the node that actually stores the Dealer object. That explains why no visible id appears even though no exception was thrown. Other frequent causes that produce no obvious error are: the app pointing at the wrong Firebase project, using Firestore UI while writing to the Realtime Database (or vice versa), database rules that block unauthenticated writes, missing INTERNET permission, or writes being queued locally when the device has no network.

Quick troubleshooting checklist

  • Confirm the app is using the correct google‑services.json (package name + project match) and the same Realtime Database instance visible in the console.
  • Verify whether the project uses Realtime Database or Cloud Firestore and inspect the correct console page.
  • Temporarily allow writes to test (set rules to allow write/read) and then revert; if writes then succeed, tighten rules and implement auth.
  • Ensure AndroidManifest has <uses-permission android:name="android.permission.INTERNET" />.
  • Check logcat for Firebase/DatabaseError messages while reproducing the write.
  • Use a completion listener (below) to capture and log errors instead of relying on silent success/failure.
  • If the device is offline, the write may be queued locally; test on a device with a known good network and verify the entry appears in the console.

Example pattern that avoids the double-push bug and captures errors

DatabaseReference newRef = dealerRef.push();
dealer.setId(newRef.getKey());
newRef.setValue(dealer, new DatabaseReference.CompletionListener() {
    @Override
    public void onComplete(DatabaseError error, DatabaseReference ref) {
        if (error != null) {
            Log.e("FirebaseWrite", "failed: " + error.getMessage());
        } else {
            Log.i("FirebaseWrite", "saved at " + ref.getPath());
        }
    }
});

As noted, quota/rate limits are possible but unlikely for a single test write; still check the Firebase console Usage/Quotas if all local checks pass. If logging the completion callback shows a permissions or auth error, adjust rules or authenticate the client, then re-lock the rules for production.

Recommended Answers

All 2 Replies

I don't see it in the supplied information. But a friend works such and they run into limits all the time.
https://firebase.google.com/docs/firestore/quotas#:~:text=10%20for%20single-document%20requests,also%20applies%20to%20each%20operation. for reference.

commented: rproffitt I created new firebase account, and just started to insert data, Just after my first insertion, I started facing this problem. +3

If this is true then it's not your code but again, limits being hit. Could be a bug on Google's end. Time to ask them in their product support forums.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.