我对FirestoreRecyclerOptions有疑问: FirestoreRecyclerOptions无法导入
com.google.firebase.firestore.MetadataChanges
编译程序时出现以下错误
java.lang.NoClassDefFoundError:无法解决以下问题:Lcom / google / firebase / firestore / MetadataChanges
我认为这是gradle中的版本问题。你知道如何解决这个问题吗?
implementation 'com.google.firebase:firebase-auth:16.1.0'
implementation 'com.google.firebase:firebase-core:16.0.7'
implementation 'com.firebaseui:firebase-ui-auth:4.3.0'
//Firestore
implementation 'com.google.firebase:firebase-firestore:18.0.1'
// FirebaseUI for Cloud Firestore
implementation 'com.firebaseui:firebase-ui-firestore:4.3.1'
implementation 'com.google.firebase:firebase-functions:16.1.3'
implementation 'com.firebaseui:firebase-ui-storage:4.3.1'
调用回收器选项时的功能
private FirestoreRecyclerOptions<chat> generateOptionsForAdapter(Query query){
return new FirestoreRecyclerOptions.Builder<chat>()
.setQuery(query,chat.class)
.setLifecycleOwner(this)
.build();
}