Все библиотеки com.android.support должны использовать одну и ту же спецификацию версии, хотя и используют одну и ту же версию.

Ниже приводится объявление зависимостей в файле gradle.

ext {
supportLibraryVersion = '27.1.1'
firebaseVersion = '16.0.3'
playServicesVersion = '15.0.1'
 }
 dependencies {

implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(':pageIndicator')
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'

implementation "com.android.support:appcompat-v7:$supportLibraryVersion"
implementation "com.android.support:recyclerview-v7:$supportLibraryVersion"
implementation "com.android.support:cardview-v7:$supportLibraryVersion"
implementation "com.android.support:design:$supportLibraryVersion"
implementation "com.android.support:customtabs:$supportLibraryVersion"
implementation "com.android.support:support-v4:$supportLibraryVersion"
implementation "com.android.support:design:$supportLibraryVersion"
implementation "com.android.support:recyclerview-v7:$supportLibraryVersion"

implementation 'com.android.support.constraint:constraint-layout:1.1.3'



implementation 'com.android.volley:volley:1.1.1'

//play services
implementation "com.google.android.gms:play-services-base:${playServicesVersion}"
implementation "com.google.android.gms:play-services-maps:${playServicesVersion}"
implementation "com.google.android.gms:play-services-places:${playServicesVersion}"
implementation "com.google.android.gms:play-services-location:${playServicesVersion}"
implementation "com.google.android.gms:play-services-plus:${playServicesVersion}"
implementation "com.google.android.gms:play-services-auth:${playServicesVersion}"
//play services

//firebase
implementation "com.google.firebase:firebase-messaging:17.3.0"
implementation "com.google.firebase:firebase-core:${firebaseVersion}"
//firebase

implementation 'com.squareup.okhttp3:okhttp:3.4.1'
implementation 'com.squareup.okhttp:okhttp-urlconnection:2.7.5'
implementation 'com.ncapdevi:frag-nav:2.4.0'

implementation 'joda-time:joda-time:2.9.9'
implementation 'com.evernote:android-job:1.1.11'
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
implementation 'com.toptoche.searchablespinner:searchablespinnerlibrary:1.3.1'
implementation 'com.facebook.android:facebook-login:4.30.0'
implementation 'com.github.chrisbanes:PhotoView:2.1.3'
implementation 'com.google.code.gson:gson:2.8.2'


}

Ниже приведен журнал запуска задачи androidDependacies.

debugCompileClasspath - Dependencies for compilation
+--- com.google.firebase:firebase-core:16.0.3@aar
+--- com.android.support:multidex:1.0.3@aar
+--- :pageIndicator (variant: debug)
+--- com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0@jar
+--- com.squareup.picasso:picasso:2.71828@aar
+--- com.android.support:design:27.1.1@aar
+--- com.rengwuxian.materialedittext:library:2.1.4@aar
+--- com.facebook.android:facebook-login:4.30.0@aar
+--- com.facebook.android:facebook-common:4.30.0@aar
+--- com.android.support:appcompat-v7:27.1.1@aar
+--- com.android.support:recyclerview-v7:27.1.1@aar
+--- com.android.support:cardview-v7:27.1.1@aar
+--- com.android.support:customtabs:27.1.1@aar
+--- com.evernote:android-job:1.1.11@aar
+--- com.google.android.gms:play-services-places:15.0.1@aar
+--- com.google.android.gms:play-services-maps:15.0.1@aar
+--- com.google.android.gms:play-services-location:15.0.1@aar
+--- com.google.android.gms:play-services-plus:15.0.1@aar
+--- com.google.android.gms:play-services-auth:15.0.1@aar
+--- com.google.android.gms:play-services-audience:15.0.1@aar
+--- com.google.android.gms:play-services-auth-api-phone:15.0.1@aar
+--- com.google.android.gms:play-services-auth-base:15.0.1@aar
+--- com.google.firebase:firebase-messaging:17.3.0@aar
+--- com.google.firebase:firebase-measurement-connector-impl:17.0.1@aar
+--- com.google.firebase:firebase-analytics:16.0.3@aar
+--- com.google.android.gms:play-services-measurement-api:16.0.1@aar
+--- com.google.firebase:firebase-analytics-impl:16.2.1@aar
+--- com.google.firebase:firebase-iid:17.0.0@aar
+--- com.google.firebase:firebase-iid-interop:16.0.0@aar
+--- com.google.android.gms:play-services-base:15.0.1@aar
+--- com.google.firebase:firebase-common:16.0.1@aar
+--- com.google.android.gms:play-services-tasks:15.0.1@aar
+--- com.google.android.gms:play-services-places-placereport:15.0.1@aar
+--- com.google.android.gms:play-services-stats:15.0.1@aar
+--- com.google.android.gms:play-services-ads-identifier:15.0.1@aar
+--- com.google.firebase:firebase-measurement-connector:17.0.0@aar
+--- com.google.android.gms:play-services-basement:15.0.1@aar
+--- com.android.support:support-v4:27.1.1@aar
+--- com.android.support.constraint:constraint-layout:1.1.3@aar
+--- com.android.volley:volley:1.1.1@aar
+--- com.squareup.okhttp3:okhttp:3.10.0@jar
+--- com.squareup.okhttp:okhttp-urlconnection:2.7.5@jar
+--- com.ncapdevi:frag-nav:2.4.0@aar
+--- joda-time:joda-time:2.9.9@jar
+--- com.toptoche.searchablespinner:searchablespinnerlibrary:1.3.1@aar
+--- com.github.chrisbanes:PhotoView:2.1.3@aar
+--- com.google.code.gson:gson:2.8.2@jar
+--- com.android.support:support-fragment:27.1.1@aar
+--- com.android.support:animated-vector-drawable:27.1.1@aar
+--- com.android.support:support-core-ui:27.1.1@aar
+--- com.android.support:transition:27.1.1@aar
+--- com.android.support:support-media-compat:27.1.1@aar
+--- com.android.support:support-vector-drawable:27.1.1@aar
+--- com.facebook.android:facebook-core:4.30.0@aar
+--- com.android.support:support-core-utils:27.1.1@aar
+--- com.android.support:support-compat:27.1.1@aar
+--- net.vrallev.android:cat:1.0.5@aar
+--- com.android.support:exifinterface:27.1.0@aar
+--- com.android.support:support-annotations:27.1.1@jar
+--- com.android.support.constraint:constraint-layout-solver:1.1.3@jar
+--- com.squareup.okhttp:okhttp:2.7.5@jar
+--- com.nineoldandroids:library:2.4.0@jar
+--- android.arch.lifecycle:runtime:1.1.0@aar
+--- com.squareup.okio:okio:1.14.0@jar
+--- com.parse.bolts:bolts-android:1.4.0@jar
+--- com.google.zxing:core:3.3.0@jar
+--- android.arch.lifecycle:livedata-core:1.1.0@aar
+--- android.arch.lifecycle:common:1.1.0@jar
+--- android.arch.core:runtime:1.1.0@aar
+--- android.arch.core:common:1.1.0@jar
+--- com.parse.bolts:bolts-applinks:1.4.0@jar
+--- com.parse.bolts:bolts-tasks:1.4.0@jar
+--- com.google.android.gms:play-services-measurement-base:16.0.2@aar
\--- android.arch.lifecycle:viewmodel:1.1.0@aar

Я не понимаю, почему отображается сообщение

firebase-core и firebase-messaging не совпадают
Abdul Kawee 10.09.2018 11:15

поскольку он недоступен для этой версии, отображается следующая ошибка Не удалось устранить: com.google.firebase: firebase-messaging: 16.0.3

amodkanthe 10.09.2018 11:18

это для Пикассо, проверьте этот ответ stackoverflow.com/a/52135661/6401241

Radesh 10.09.2018 11:52
0
3
257
1

Ответы 1

Обычно я исправляю эту ошибку, помещая это в файл gradle:

// use default version for all support repositories
configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion 'PUT_THE_VERSION_YOU_WANT' //27.1.1 in your case
            }
        }
    }
}

Возможно, вам придется добавить multiDexEnabled true внутри android. По сути, это заставляет все использовать определенную версию, чтобы у них не было никаких конфликтов.

Другие вопросы по теме