【问题标题】:fix the version conflict either by updating the version of the google-services plugin通过更新 google-services 插件的版本来修复版本冲突
【发布时间】:2019-01-21 17:08:55
【问题描述】:

我在我的项目中使用 Google 的 Firebase(用于通知)和 Places(用于地址和位置)API。两者的最新版本分别是我在应用程序中使用的 16.0.6 和 16.0.0。

当集成任一 api 时,应用程序运行良好。但是在集成在一起时会出现以下错误:

任务“:app:processDebugGoogleServices”执行失败。

请通过更新 google-services 插件的版本(有关最新版本的信息可在 https://bintray.com/android/android-tools/com.google.gms.google-services/ 获得)或将 com.google.android.gms 的版本更新到 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'

有没有其他方法可以同时使用两者?

【问题讨论】:

    标签: android android-gradle-plugin firebase-cloud-messaging google-places-api google-play-services


    【解决方案1】:

    我无法弄清楚这里有什么问题。但我尝试将两个库的版本号降级为 12.0.1,效果很好。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多