Исправить конфликт версий, либо обновив версию плагина google-services

Я использую API Google Firebase (для уведомлений) и Places (для адреса и местоположения) в своем проекте. Последние версии обоих — 16.0.6 и 16.0.0 соответственно, которые я использую в приложении.

При интеграции любого API приложение работает нормально. Но при объединении вместе это дает следующую ошибку:

Execution failed for task ':app:processDebugGoogleServices'.

Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 16.0.6.

Я также проверил другие сообщения, но они уже устарели и не помогают мне.

Ниже приведен build.gradle моего модуля приложения.

apply plugin: 'com.android.application'

buildscript {
    repositories {
        google()
        mavenCentral()
        maven { url 'https://maven.fabric.io/public' }
        maven {
            url "https://maven.google.com"
        }

    }
    dependencies {
        // replace with the current version of the Android plugin
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:3.1.1'
    }
}

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "abc.xyz"
        minSdkVersion 19
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true

        // add below section
        javaCompileOptions {
            annotationProcessorOptions {
                includeCompileClasspath true
            }
        }
    }
    buildTypes {
        debug {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            debuggable true
            signingConfig signingConfigs.Release
            zipAlignEnabled true
        }
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            debuggable false
            signingConfig signingConfigs.Release
            zipAlignEnabled true
        }
    }
}

repositories {
    maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}

configurations {
    all*.exclude group: 'com.android.support', module: 'support-v13'
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:26.1.0'

    //LinkedIn SDK
    implementation project(':linkedin-sdk')
    implementation 'com.github.bumptech.glide:glide:3.8.0'
    implementation 'com.ethanhua:skeleton:1.1.2'
    implementation 'io.supercharge:shimmerlayout:2.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    testImplementation 'junit:junit:4.12'
    implementation 'com.google.code.gson:gson:2.8.2'
    implementation 'com.android.support:design:26.1.0'
    implementation 'com.android.support:recyclerview-v7:26.1.0'
    implementation 'com.facebook.android:facebook-android-sdk:4.34.0'
    implementation 'com.google.code.gson:gson:2.8.2'
    implementation 'de.hdodenhof:circleimageview:2.1.0'
    implementation 'org.androidannotations:androidannotations-api:4.3.1'

    <!-- Google apis -->
    implementation 'com.google.firebase:firebase-core:16.0.6'
    implementation 'com.google.android.gms:play-services:12.0.1'
    implementation 'com.google.android.gms:play-services-places:16.0.0'

    annotationProcessor 'org.androidannotations:androidannotations:4.3.1'
}

apply plugin: 'com.google.gms.google-services'

Есть ли другой способ, которым я могу работать с обоими?

0
0
133
1

Ответы 1

Я не мог понять, что здесь не так. Но я попытался понизить номер версии до 12.0.1 обеих библиотек, и все заработало нормально.

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