【问题标题】:Version conflict (google-services plugin)版本冲突(google-services 插件)
【发布时间】:2018-05-05 14:31:38
【问题描述】:

请通过更新版本来修复版本冲突 google-services 插件(有关最新版本的信息是 可在 https://bintray.com/android/android-tools/com.google.gms.google-services/) 或将 com.google.android.gms 的版本更新为 15.0.2。

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'


repositories {
    maven { url 'https://maven.fabric.io/public' }
}

android {


    compileSdkVersion 26
//    buildToolsVersion '27.0.3'
    defaultConfig {
        applicationId "com.test.android"
        minSdkVersion 16
        targetSdkVersion 22
        signingConfig signingConfigs.config
        versionCode 9
        versionName '3.6'
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
        debug {
            //     signingConfig signingConfigs.config
        }
    }
    packagingOptions {
        // exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/maven/com.squareup.picasso/picasso/pom.xml'
    }
    productFlavors {
    }
    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation project(':slidingmenu_libs')
    implementation project(':sqlite_helper')
    implementation files('libs/httpclient-4.2.5.jar')
    implementation files('libs/httpcore-4.2.4.jar')
    implementation files('libs/httpmime-4.2.1.jar')
    implementation files('libs/lib-autonotifyviewpager.jar')
    implementation files('libs/YouTubeAndroidPlayerApi.jar')
    implementation('com.twitter.sdk.android:tweet-composer:1.0.3@aar') {
        transitive = true;
    }
    implementation 'com.android.volley:volley:1.1.0'
    implementation 'com.eftimoff:android-viewpager-transformers:1.0.1@aar'
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support:customtabs:26.1.0'
    implementation 'com.android.support:recyclerview-v7:26.1.0'
    implementation 'com.android.support:cardview-v7:26.1.0'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.google.firebase:firebase-messaging:15.0.2'
    implementation 'com.google.firebase:firebase-ads:15.0.1'
    implementation 'com.google.android.gms:play-services-auth:15.0.1'
    implementation 'com.google.android.gms:play-services-plus:15.0.1'
    implementation 'com.facebook.android:facebook-android-sdk:4.24.0'
    implementation 'jp.wasabeef:recyclerview-animators:2.2.1'
    implementation 'com.github.ksoichiro:android-observablescrollview:1.6.0'
    implementation 'com.nineoldandroids:library:2.4.0'
    implementation 'com.joanzapata.pdfview:android-pdfview:1.0.4@aar'
    testImplementation 'junit:junit:4.12'
    implementation('com.crashlytics.sdk.android:crashlytics:2.8.0@aar') {
        transitive = true;
    }
}
apply plugin: 'com.google.gms.google-services'

【问题讨论】:

  • 您更新了 google-service 插件吗?它位于 build.gradle(Project) 下的dependecies部分,最后一个版本是classpath 'com.google.gms:google-services:3.3.0' // google-services plugin
  • @E.Abdel 更新后可以正常工作
  • 很好,请发布答案并接受它以帮助其他人

标签: android gradle


【解决方案1】:

将 google-service 插件更新为 'com.google.gms:google-services:3.3.0'

但是,最好在同一个库文件中使用相同的版本,以防止任何项目同步崩溃。

例子,

implementation 'com.google.firebase:firebase-messaging:15.0.2'
implementation 'com.google.firebase:firebase-ads:15.0.2'
implementation 'com.google.android.gms:play-services-auth:15.0.2'
implementation 'com.google.android.gms:play-services-plus:15.0.2'

【讨论】:

  • @Kapi Bryant 谢谢你的回答,我已经解决了,看评论
【解决方案2】:

有时在您更新 google play 服务或 firebase 依赖项时会发生这种情况,您可以通过更新 build.gradle(项目)文件中的播放服务插件来解决它:

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'
    }
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-01-12
    • 2020-01-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多