androidgoogle-cloud-firestorefirebase-authenticationfirebaseui

i'm Getting error while using FirestoreRecyclerOptions What sholud i do


Cannot resolve symbol 'FirestoreRecyclerOptions'

dependencies {

    implementation 'com.firebaseui:firebase-ui-auth:8.0.1'
    implementation 'com.firebaseui:firebase-ui-database:8.0.1'
    implementation 'com.facebook.android:facebook-login:8.1.0'
    implementation 'androidx.fragment:fragment-ktx:1.5.5'
    implementation 'androidx.appcompat:appcompat:1.5.1'
    implementation 'com.google.android.material:material:1.7.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    implementation 'com.google.firebase:firebase-storage:20.0.1'
    implementation 'com.google.firebase:firebase-database:20.0.4'
    implementation 'androidx.gridlayout:gridlayout:1.0.0'
    implementation 'com.google.firebase:firebase-firestore-ktx:24.4.4'
    testImplementation 'junit:junit:4.13.2'
    implementation 'com.karumi:dexter:6.2.3'

    androidTestImplementation 'androidx.test.ext:junit:1.1.4'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
}

firestore=FirebaseFirestore.getInstance();
Query query=firestore.collection("playlist");

        FirestoreRecyclerOptions<pagl> options = new FirestoreRecyclerOptions.Builder<pagl[enter image description here][1]>()
                .setQuery(query, pagl.class)
                .build();

Solution

  • You've added a dependency for FirebaseUI for the Realtime Database, but your code is trying to use FirebaseUI for Cloud Firestore. While both databases are part of Firebase, they are completely separate and the UI for one can't be used with the other.

    To use FirebaseUI with Firestore, add this dependency:

    // FirebaseUI for Cloud Firestore
    implementation 'com.firebaseui:firebase-ui-firestore:8.0.1'
    

    Also see the documentation on installing FirebaseUI.