сборка gradle не удалась при добавлении Firebase ML - PullRequest
0 голосов
/ 13 июня 2018

Зависимости моего проекта указаны ниже:

dependencies {
    classpath 'com.android.tools.build:gradle:3.1.3'
    classpath 'com.google.gms:google-services:4.0.1'
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

После изменения исходных зависимостей, как показано ниже:

dependencies {
    implementation 'com.android.support:support-v4:27.0.1'
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:26.0.1'
    implementation 'com.android.support:design:27.0.1'
    implementation 'com.google.android.gms:play-services-auth:15.0.1'
    implementation 'com.google.android.gms:play-services-ads:15.0.1'
    implementation 'com.google.android.gms:play-services-wearable:15.0.1'
    implementation 'com.google.android.gms:play-services-maps:15.0.1'
    implementation 'com.google.firebase:firebase-auth:16.0.1'
    implementation 'com.google.firebase:firebase-database:11.8.0'
    implementation 'com.google.firebase:firebase-messaging:17.0.0'
    implementation 'com.firebaseui:firebase-ui:2.3.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    implementation 'com.gongwen:marqueelibrary:1.1.3'
    implementation 'devlight.io:navigationtabbar:1.2.5'
    implementation 'me.itangqi.waveloadingview:library:0.3.5'
    implementation 'com.yanzhenjie:recyclerview-swipe:1.1.4'
    implementation 'com.squareup.okhttp3:okhttp:3.2.0'
    implementation 'com.squareup.okio:okio:1.7.0'
    implementation 'com.google.firebase:firebase-ml-vision:16.0.0'
    implementation 'com.android.support:multidex:1.0.0'
}
apply plugin: 'com.android.application'

Затем я добавил зависимости ML для firebase,

com.google.firebase:firebase-ml-vision:16.0.0   

Сборка Gradle завершилась неудачно, сообщив следующее сообщение:

Исправьте конфликт версий, либо обновив версию плагина google-services (информация о последней версии доступна на https://bintray.com/android/android-tools/com.google.gms.google-services/) или обновить версию com.google.android.gms до 11.4.2.

Может ли кто-нибудь помочь мне решить эту проблему?

1 Ответ

0 голосов
/ 13 июня 2018

Обновите следующее:

compile 'com.google.firebase:firebase-auth:11.4.2'
compile 'com.google.firebase:firebase-database:11.4.2'
compile 'com.google.firebase:firebase-messaging:11.4.2'

до этого:

implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-messaging:17.0.0'

Также обновите API сервисов Google Play до последней версии

И в файле Gradle верхнего уровня:

измените:

classpath 'com.google.gms:google-services:3.1.0'

на это:

classpath 'com.google.gms:google-services:4.0.1'
...