我有一个应用程序,我使用firebase身份验证,firebase存储,firebase实时数据库,firebase消息和谷歌地图活动。但是当我集成firebase存储依赖时,应用程序崩溃了。告诉我应该使用哪个版本,这样我的应用程序才能顺利运行。
依赖项如下:
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.google.firebase:firebase-auth:17.0.0'
implementation 'com.google.firebase:firebase-storage:16.0.4'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.'
implementation 'androidx.navigation:navigation-fragment:2.1.0'
implementation 'androidx.navigation:navigation-ui:2.1.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.firebaseui:firebase-ui-database:6.2.1'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation 'de.hdodenhof:circleimageview:3.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.orhanobut:dialogplus:1.11@aar'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-database:16.0.6'
implementation 'com.google.firebase:firebase-core:16.0.7'
implementation 'com.karumi:dexter:5.0.0'
implementation 'com.firebaseui:firebase-ui-database:6.4.0'
implementation 'com.firebaseui:firebase-ui-auth:6.4.0'
implementation 'com.github.d-max:spots-dialog:1.1@aar'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.github.mancj:MaterialSearchBar:0.8.2'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'io.reactivex.rxjava2:rxjava:2.1.7'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'io.paperdb:paperdb:2.6'
}
请指导我应该使用哪些依赖项。
根据Firebase的最新发布说明:
最新的Firebase BoM版本包含每个Firebase Android库的最新版本。
因为你正在使用:
我有一个应用程序,我使用Firebase认证,Firebase存储,Firebase实时数据库,Firebase消息
你的Firebase依赖实现应该是这样的:
implementation platform('com.google.firebase:firebase-bom:26.5.0')
implementation 'com.google.firebase:firebase-auth'
implementation 'com.google.firebase:firebase-storage'
implementation 'com.google.firebase:firebase-database'
implementation 'com.google.firebase:firebase-messaging'
如您所见,没有必要为每个工件指定版本。
使用相同的auth和storage依赖
implementation 'com.google.firebase:firebase-auth:17.0.0'
implementation 'com.google.firebase:firebase-storage:17.0.0'