Сборка завершается с «Тип программы уже присутствует: android.arch.core.util.Function» - Проблемы с зависимостями Firebase - PullRequest
0 голосов
/ 14 ноября 2018

У меня есть различные библиотеки Firebase в моем проекте, и кажется, что существует какой-то конфликт, приводящий к сбою сборки. Ниже мой build.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 ]

0 голосов
/ 19 ноября 2018

Оказывается, проблема была связана либо с зависимостями базы данных Firebase, либо с зависимостями пользовательского интерфейса Firebase.Мне удалось решить с зависимостями ниже:

    // 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'
0 голосов
/ 15 ноября 2018

Чтобы решить эту проблему, измените следующие строки кода:

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'

Обязательно используйте ' вместо ".

...