我正在制作一个回收器视图。当我尝试添加firebase的database-ui时,它似乎不起作用。I got error:
Cannot resolve symbol 'FirebaseRecyclerOptions'
我发现它没有被导入,并手动导入,但出现错误:
Cannot resolve symbol 'firebase'
我寻找解决方案。2022年5月3日更新所有firebase依赖的最新版本。但一切都没有改变。
这是我的依赖项:
dependencies {
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation platform('com.google.firebase:firebase-bom:29.3.1')
implementation 'com.google.firebase:firebase-auth:21.0.3'
implementation 'com.google.firebase:firebase-database:20.0.4'
implementation 'com.google.firebase:firebase-storage:20.0.1'
implementation 'com.google.firebaseui:firebase-ui-database:8.0.1'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1'
implementation 'androidx.navigation:navigation-fragment:2.4.2'
implementation 'androidx.navigation:navigation-ui:2.4.2'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.cardview:cardview:1.0.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
This is import:
import com.firebase.ui.database.FirebaseRecyclerOptions;
好的。我通过改变依赖项来解决这个问题:
implementation 'com.google.firebaseui:firebase-ui-database:8.0.1'
:
implementation 'com.firebaseui:firebase-ui-database:8.0.1'
com.
后无google.
。
Thanks to Sam: https://groups.google.com/g/google-cloud-firestore-discuss/c/ZfuZ6QSd-kM?pli=1