Could not complete scheduled request to refresh entries. ClientErrorCode: 3

Viewed 6380

I am getting an unusual error of Firebase UI recycler views.. I have also included error attachment. This is an Firebase Recycler view. wheere i am using firebase recycler adapter. Whenever I go to users activity it gets crashing giving unusual error in logcat. Please help. This is my code:

private Toolbar mToolbar;
private RecyclerView mUsersList;

private DatabaseReference AllUsersRef;
private FirebaseAuth mAuth;
String currentUserID;
private Query query;

private FirebaseRecyclerOptions<Users> options;
private FirebaseRecyclerAdapter<Users, UsersViewHolder> adapter;

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


    AllUsersRef = FirebaseDatabase.getInstance().getReference().child("users");

    mToolbar = findViewById(R.id.users_app_bar);
    setSupportActionBar(mToolbar);
    getSupportActionBar().setTitle("All Users");
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

    mUsersList = findViewById(R.id.users_list);
    mUsersList.setHasFixedSize(true);
    LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
    mUsersList.setLayoutManager(linearLayoutManager);

}

@Override
protected void onStart() {
    super.onStart();

    AllUsersRef.child("online").setValue(true);

    options = new FirebaseRecyclerOptions.Builder<Users>().setQuery(AllUsersRef, Users.class).build();

    adapter = new FirebaseRecyclerAdapter<Users, UsersViewHolder>(options) {
        @Override
        protected void onBindViewHolder(@NonNull UsersViewHolder holder, int position, @NonNull Users model) {

            final String user_id = getRef(position).getKey();

            holder.mName.setText(model.getName());
            holder.mStatus.setText(model.getStatus());

            Picasso.get().load(model.getImage()).into(holder.mImage);

            holder.itemView.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Intent profileIntent = new Intent(UsersActivity.this, ProfileActivity.class);
                    profileIntent.putExtra("user_id", user_id);
                    startActivity(profileIntent);
                }
            });
        }

        @NonNull
        @Override
        public UsersViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {

            View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.users_display_layout, viewGroup, false);

            return new UsersViewHolder(view);
        }
    };

    adapter.startListening();
    mUsersList.setAdapter(adapter);
}


@Override
protected void onStop() {
    super.onStop();

    FirebaseUser currentUser = FirebaseAuth.getInstance().getCurrentUser();

    if(currentUser != null) {

        //AllUsersRef.child("online").setValue(false);
    }

}
}

This is my LOgCat error:

08-30 18:16:01.581 2667-9189/com.google.android.googlequicksearchbox:search E/EntrySyncManager: Cannot determine account name: drop request
08-30 18:16:01.582 2667-9189/com.google.android.googlequicksearchbox:search E/NowController: Failed to access data from EntryProvider. ExecutionException.
    java.util.concurrent.ExecutionException: com.google.android.apps.gsa.sidekick.main.h.n: Could not complete scheduled request to refresh entries. ClientErrorCode: 3
        at com.google.common.util.concurrent.d.eA(SourceFile:85)
        at com.google.common.util.concurrent.d.get(SourceFile:23)
        at com.google.common.util.concurrent.l.get(SourceFile:2)
        at com.google.android.apps.gsa.staticplugins.nowstream.b.a.be.caI(SourceFile:47)
        at com.google.android.apps.gsa.staticplugins.nowstream.b.a.be.caH(SourceFile:176)
        at com.google.android.apps.gsa.staticplugins.nowstream.b.a.bh.run(Unknown Source:2)
        at com.google.android.apps.gsa.shared.util.concurrent.at.run(SourceFile:4)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at com.google.android.apps.gsa.shared.util.concurrent.b.g.run(Unknown Source:4)
        at com.google.android.apps.gsa.shared.util.concurrent.b.aw.run(SourceFile:4)
        at com.google.android.apps.gsa.shared.util.concurrent.b.aw.run(SourceFile:4)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:764)
        at com.google.android.apps.gsa.shared.util.concurrent.b.i.run(SourceFile:6)
     Caused by: com.google.android.apps.gsa.sidekick.main.h.n: Could not complete scheduled request to refresh entries. ClientErrorCode: 3
        at com.google.android.apps.gsa.staticplugins.nowstream.b.a.aq.az(Unknown Source:4)
        at com.google.common.util.concurrent.q.ap(SourceFile:7)
        at com.google.common.util.concurrent.p.run(SourceFile:32)
        at com.google.common.util.concurrent.bt.execute(SourceFile:3)
        at com.google.common.util.concurrent.d.b(SourceFile:275)
        at com.google.common.util.concurrent.d.addListener(SourceFile:135)
        at com.google.common.util.concurrent.p.b(SourceFile:3)
        at com.google.android.apps.gsa.shared.util.concurrent.h.a(SourceFile:16)
        at com.google.android.apps.gsa.shared.util.concurrent.h.a(SourceFile:13)
        at com.google.android.apps.gsa.staticplugins.nowstream.b.a.be.caI(SourceFile:45)
        at com.google.android.apps.gsa.staticplugins.nowstream.b.a.be.caH(SourceFile:176) 
        at com.google.android.apps.gsa.staticplugins.nowstream.b.a.bh.run(Unknown Source:2) 
        at com.google.android.apps.gsa.shared.util.concurrent.at.run(SourceFile:4) 
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458) 
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458) 
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
        at com.google.android.apps.gsa.shared.util.concurrent.b.g.run(Unknown Source:4) 
        at com.google.android.apps.gsa.shared.util.concurrent.b.aw.run(SourceFile:4) 
        at com.google.android.apps.gsa.shared.util.concurrent.b.aw.run(SourceFile:4) 
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
        at java.lang.Thread.run(Thread.java:764) 
        at com.google.android.apps.gsa.shared.util.concurrent.b.i.run(SourceFile:6)

 enter image description here

1 Answers

Hey I had the same problem but I realized the real problem was a few lines above this error on the LogCat. It turns out I was setting the text of a button on my holder as an int and that caused the problem, cause I need to use a classic String.valueOf() which fixed my problem.

Since your problem doesn't seem to be related to Firebase, maybe the problem could be on the holder.mStatus.setText(model.getStatus()); line, if by chance your getStatus() method is returning an int. Just as in my case, you should try surrounding it with a String.valueOf().

Hope this helps, good luck!

Related