Java – Unable to parse symbol “FirebaseRecyclerOptions”

Unable to parse symbol “FirebaseRecyclerOptions”… here is a solution to the problem.

Unable to parse symbol “FirebaseRecyclerOptions”

I’m making chat messengers through Firebase, but my Android Studio 2.3.2 can’t parse symbols for FirebaseRecyclerOptions<> even though my app is successfully connected to Firebase and properly configured to the Firebase real-time database and Firebase RecyclerAdaper imports are also good.

It seems that the build.gradle dependencies are synchronized and normal. I need help from others.

Below are my dependencies and code in MainActivities.

Several other dependencies were added and tried in build.gradle

private FirebaseRecyclerAdapter<ChatMessage, MessageViewHolder> mFirebaseAdapter;  Ph4 Reading chat

private static final String MESSAGES_CHILD = "messages";  Ph3 Chat DB

private DatabaseReference mFirebaseDatabaseReference;  Ph3 Chat DB
private EditText mMessageEditText;  Ph3 DB

private FirebaseAuth mFirebaseAuth;
private FirebaseUser mFirebaseUser;

private String mUsername;  Ph3 Chat DB
private String mPhotoUrl;  Ph3 DB

private GoogleApiClient mGoogleApiClient;  Ph2 Log-out

@Override // Ph2 Log-out
public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {


public static class MessageViewHolder extends RecyclerView.ViewHolder { // 내부클래스
    TextView nameTextView;
    ImageView messageImageView;
    TextView messageTextView;
    CircleImageView photoImageView;

public MessageViewHolder(View itemView) {

nameTextView = (TextView) itemView.findViewById(;
        messageImageView = (ImageView) itemView.findViewById(;
        messageTextView = (TextView) itemView.findViewById(;
        photoImageView = (CircleImageView) itemView.findViewById(;

private RecyclerView mMessageRecyclerView;

protected void onCreate(Bundle savedInstanceState) {

mFirebaseDatabaseReference = FirebaseDatabase.getInstance().getReference();  Ph3 Chat DB
    mMessageEditText = (EditText) findViewById(;  Ph3 DB

mMessageRecyclerView = (RecyclerView) findViewById(;

findViewById( View.OnClickListener() { // Ph3 Chat DB
        public void onClick(View v) {
            ChatMessage chatMessage = new ChatMessage(mMessageEditText.getText().toString(),
                    mUsername, mPhotoUrl, null);

mGoogleApiClient = new GoogleApiClient.Builder(this) // Ph2 Log-out
            .enableAutoManage(this, this)

mFirebaseAuth = FirebaseAuth.getInstance();
    mFirebaseUser = mFirebaseAuth.getCurrentUser();
    if (mFirebaseUser == null) {
        startActivity(new Intent(this, SignInActivity.class));
    } else {
        mUsername = mFirebaseUser.getDisplayName();
        if (mFirebaseUser.getPhotoUrl() != null ) {
            mPhotoUrl = mFirebaseUser.getPhotoUrl().toString();

Query query = mFirebaseDatabaseReference.child(MESSAGES_CHILD);  Ph4 Reading chat
    FirebaseRecyclerOptions<ChatMessage> options = new FirebaseRecyclerOptions.Builder<ChatMessage>() //ph4
            .setQuery(query, ChatMessage.class)

mFirebaseAdapter = new FirebaseRecyclerAdapter<ChatMessage, MessageViewHolder>(options) { // Ph4 Reading chat

        protected void onBindViewHolder(MessageViewHolder holder, int position, ChatMessage model) {
            if (model.getPhotoUrl() == null) {
            } else {

        public MessageViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
            View view = LayoutInflater.from(parent.getContext())
                    .inflate(R.layout.item_message, parent, false);
            return new MessageViewHolder(view);

        protected void populateViewHolder(MessageViewHolder viewHolder, ChatMessage model, int position) {


mMessageRecyclerView.setLayoutManager(new LinearLayoutManager(this));  Ph4
    mMessageRecyclerView.setAdapter(mFirebaseAdapter);  Ph4

protected void onStart() { // Ph4 Reading chat

protected void onStop() { // Ph4 Reading chat

@Override // Ph2 Log-out
public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(, menu);
    return true;

@Override // Ph2 Log-out
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
            mUsername = "";
            startActivity(new Intent(this, SignInActivity.class));
            return true;
            return super.onOptionsItemSelected(item);
  1. Below is build.gradle
    compile ''
    compile ''
    compile ''
    compile ''
    compile 'de.hdodenhof:circleimageview:3.0.0'
    compile ''
    compile ''
    testCompile 'junit:junit:4.12'
    compile ''

compile 'com.firebaseui:firebase-ui-database:2.0.0'

compile 'com.github.bumptech.glide:glide:4.6.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.6.0'

apply plugin: ''


You need to update your FirebaseUI dependencies to use the following in your build.gradle:

implementation 'com.firebaseui:firebase-ui-database:4.3.2' 

FirebaseRecyclerOptions was added to Firebaseui 3.0 and you are using Firebaseui 2.0, which is why you are receiving this error.

More information here:

Check the following:

Adapter initialization – in previous versions the adapter classes (FirebaseRecyclerAdapter, FirebaseListAdapter , etc) had multiple constructor overloads. In 3.x, each adapter has a single constructor that takes an Options object like FirebaseRecyclerOptions . These options objects can be constructed via their respective builders. For more information, see database/


The current latest version of FirebaseUI is 6.4.0:

implementation 'com.firebaseui:firebase-ui-database:6.4.0'

Related Problems and Solutions