我的项目中有各种Firebase库,似乎存在某种冲突导致构建失败。下面是我的建筑.gradle:
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
// Support library
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:appcompat-v7:27.1.1'
// Firebase
implementation 'com.google.firebase:firebase-storage:16.0.4'
implementation 'com.google.firebase:firebase-core:16.0.5'
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.android.gms:play-services-auth:16.0.1'
implementation 'com.google.firebase:firebase-appindexing:16.0.2'
implementation 'com.google.firebase:firebase-firestore:17.1.3'
implementation 'com.firebaseui:firebase-ui-firestore:4.2.1'
// Third party
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.facebook.android:facebook-android-sdk:4.38.1'
implementation 'jp.wasabeef:recyclerview-animators:2.2.3'
implementation 'com.github.clans:fab:1.6.2'
implementation 'de.hdodenhof:circleimageview:2.0.0'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.squareup.okhttp3:okhttp:3.11.0'
implementation 'com.github.PhilJay:MPAndroidChart:v2.2.2'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
implementation 'com.android.support:multidex:1.0.3'
//
// implementation "android.arch.core:runtime:1.1.1"
// implementation "android.arch.core:common:1.1.1"
}
当我添加以下内容时,我能够成功构建:
implementation "android.arch.core:runtime:1.1.1"
implementation "android.arch.core:common:1.1.1"
我在这里发布了一个类似的问题,我也在那里发布了我的日志以供参考。我担心的是,添加上面的2个依赖项只是一个临时解决方案,因为我不想发布带有这些依赖项的应用程序。感谢您的帮助!
要解决此问题,请更改以下代码行:
implementation 'com.google.firebase:firebase-database:16.0.4'
implementation 'com.firebaseui:firebase-ui-database:4.2.0'
implementation "com.google.firebase:firebase-firestore:17.1.2"
implementation 'com.firebaseui:firebase-ui-firestore:4.0.1'
至
implementation 'com.google.firebase:firebase-database:16.0.5'
implementation 'com.firebaseui:firebase-ui-database:4.2.1'
implementation 'com.google.firebase:firebase-firestore:17.1.3'
implementation 'com.firebaseui:firebase-ui-firestore:4.2.1'
还要确保使用'
而不是"
。
事实证明,该问题与Firebase数据库依赖项或Firebase UI依赖项有关。我能够解决以下依赖关系:
// Firebase
implementation 'com.google.firebase:firebase-storage:16.0.4'
implementation 'com.google.firebase:firebase-core:16.0.5'
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.android.gms:play-services-auth:16.0.1'
implementation 'com.google.firebase:firebase-appindexing:16.0.2'
implementation 'com.google.firebase:firebase-firestore:17.1.3'
implementation 'com.firebaseui:firebase-ui-firestore:4.2.1'