com.google.android.gms的版本冲突

时间:2016-07-30 21:16:51

标签: android gradle android-gradle google-play-services

我试图使用这个库 https://github.com/uPhyca/GAlette。这取决于较旧版本的Google Analytics,但它在说明中可以强制您使用特定版本。

force "com.google.android.gms:play-services-analytics:${playservicesVersion}"

我这样做了,这是我得到的错误信息:

  

引起:org.gradle.api.GradleException:请通过更新google-services插件的版本(有关最新版本的信息可在https://bintray.com/android/android-tools/com.google.gms.google-services/获得)或更新版本来解决版本冲突com.google.android.gms到9.2.1。

这里是' gradle任务的输出':

_debugApk - ## Internal use, do not manually configure ##
+--- com.android.support:support-v4:23.+ -> 23.4.0
|    \--- com.android.support:support-annotations:23.4.0
+--- com.android.support:appcompat-v7:23.+ -> 23.4.0
|    +--- com.android.support:animated-vector-drawable:23.4.0
|    |    \--- com.android.support:support-vector-drawable:23.4.0
|    |         \--- com.android.support:support-v4:23.4.0 (*)
|    +--- com.android.support:support-v4:23.4.0 (*)
|    \--- com.android.support:support-vector-drawable:23.4.0 (*)
+--- com.android.support:support-v13:23.+ -> 23.4.0
|    \--- com.android.support:support-v4:23.4.0 (*)
+--- com.android.support:design:23.+ -> 23.4.0
|    +--- com.android.support:recyclerview-v7:23.4.0
|    |    +--- com.android.support:support-annotations:23.4.0
|    |    \--- com.android.support:support-v4:23.4.0 (*)
|    +--- com.android.support:appcompat-v7:23.4.0 (*)
|    \--- com.android.support:support-v4:23.4.0 (*)
+--- com.android.support:cardview-v7:23.+ -> 23.4.0
+--- com.android.support:percent:23.+ -> 23.4.0
|    \--- com.android.support:support-v4:23.4.0 (*)
+--- com.github.medyo:android-about-page:1.0.+ -> 1.0.9
|    \--- com.android.support:appcompat-v7:23.3.0 -> 23.4.0 (*)
+--- com.balysv:material-ripple:1.0.2
+--- com.android.volley:volley:1.+ -> 1.0.0
+--- org.jraf:android-switch-backport:2.0.1
|    \--- com.android.support:appcompat-v7:22.0.0 -> 23.4.0 (*)
+--- com.mcxiaoke.viewpagerindicator:library:2.4.1
|    \--- com.android.support:support-v4:19.1.0 -> 23.4.0 (*)
+--- com.wdullaer:materialdatetimepicker:1.4.2
|    \--- com.android.support:support-v4:22.0.0 -> 23.4.0 (*)
+--- com.miguelcatalan:materialsearchview:1.4.0
|    +--- com.android.support:appcompat-v7:23.1.1 -> 23.4.0 (*)
|    \--- com.android.support:design:23.1.1 -> 23.4.0 (*)
+--- org:jaudiotagger:2.0.3
+--- org.jsoup:jsoup:1.8.+ -> 1.8.3
+--- com.zzhoujay.materialcolors:materialcolors:1.0.0
+--- com.squareup.retrofit:retrofit:1.+ -> 1.9.0
|    \--- com.google.code.gson:gson:2.3.1
+--- com.squareup.okhttp:okhttp:2.+ -> 2.7.5
|    \--- com.squareup.okio:okio:1.6.0
+--- com.github.geecko86:SpotifyApi:3
|    +--- com.squareup.retrofit:retrofit:1.+ -> 1.9.0 (*)
|    +--- com.android.support:support-annotations:21.0.0 -> 23.4.0
|    +--- com.squareup.okhttp:okhttp:2.+ -> 2.7.5 (*)
|    \--- com.squareup.okhttp:okhttp-urlconnection:2.+ -> 2.7.5
|         \--- com.squareup.okhttp:okhttp:2.7.5 (*)
+--- com.google.firebase:firebase-ads:9.2.1
|    +--- com.google.android.gms:play-services-ads:9.2.1
|    |    +--- com.google.android.gms:play-services-ads-lite:9.2.1
|    |    |    \--- com.google.android.gms:play-services-basement:9.2.1
|    |    |         \--- com.android.support:support-v4:23.0.0 -> 23.4.0 (*)
|    |    +--- com.google.android.gms:play-services-base:9.2.1
|    |    |    +--- com.google.android.gms:play-services-basement:9.2.1 (*)
|    |    |    \--- com.google.android.gms:play-services-tasks:9.2.1
|    |    |         \--- com.google.android.gms:play-services-basement:9.2.1 (*)
|    |    +--- com.google.android.gms:play-services-clearcut:9.2.1
|    |    |    +--- com.google.android.gms:play-services-base:9.2.1 (*)
|    |    |    \--- com.google.android.gms:play-services-basement:9.2.1 (*)
|    |    +--- com.google.android.gms:play-services-basement:9.2.1 (*)
|    |    \--- com.google.android.gms:play-services-gass:9.2.1
|    |         \--- com.google.android.gms:play-services-basement:9.2.1 (*)
|    \--- com.google.firebase:firebase-analytics:9.2.1
|         +--- com.google.android.gms:play-services-basement:9.2.1 (*)
|         +--- com.google.firebase:firebase-common:9.2.1
|         |    +--- com.google.android.gms:play-services-basement:9.2.1 (*)
|         |    \--- com.google.android.gms:play-services-tasks:9.2.1 (*)
|         \--- com.google.firebase:firebase-analytics-impl:9.2.1
|              +--- com.google.android.gms:play-services-basement:9.2.1 (*)
|              +--- com.google.firebase:firebase-iid:9.2.1
|              |    +--- com.google.android.gms:play-services-basement:9.2.1 (*)
|              |    \--- com.google.firebase:firebase-common:9.2.1 (*)
|              \--- com.google.firebase:firebase-common:9.2.1 (*)
+--- com.google.firebase:firebase-crash:9.2.1
|    +--- com.google.android.gms:play-services-base:9.2.1 (*)
|    +--- com.google.android.gms:play-services-basement:9.2.1 (*)
|    +--- com.google.firebase:firebase-iid:9.2.1 (*)
|    +--- com.google.firebase:firebase-common:9.2.1 (*)
|    \--- com.google.firebase:firebase-analytics:9.2.1 (*)
+--- com.google.android.gms:play-services-analytics:8.4.0 -> 9.2.1
|    +--- com.google.android.gms:play-services-analytics-impl:9.2.1
|    |    +--- com.google.android.gms:play-services-base:9.2.1 (*)
|    |    \--- com.google.android.gms:play-services-basement:9.2.1 (*)
|    +--- com.google.android.gms:play-services-base:9.2.1 (*)
|    \--- com.google.android.gms:play-services-basement:9.2.1 (*)
+--- com.uphyca.galette:galette:0.9.15
|    \--- com.google.android.gms:play-services-analytics:8.4.0 -> 9.2.1 (*)
+--- com.google.firebase:firebase-core:9.2.1
|    \--- com.google.firebase:firebase-analytics:9.2.1 (*)
\--- com.squareup.leakcanary:leakcanary-android:1.4-beta2
     \--- com.squareup.leakcanary:leakcanary-analyzer:1.4-beta2
          +--- com.squareup.leakcanary:leakcanary-watcher:1.4-beta2
          \--- com.squareup.haha:haha:2.0.2

这是我的build.gradle

apply plugin: 'com.android.application'

repositories {
    mavenCentral()
    jcenter()
    maven {
        url 'https://oss.sonatype.org/content/repositories/snapshots/'
    }
    maven {
        url "https://jitpack.io"
    }
}

configurations.all {
    resolutionStrategy {
        force "com.google.gms:google-services:3.0.0"
        force "com.google.android.gms:play-services-analytics:9.2.1"
    }
}

buildscript {
    repositories {
        mavenCentral()
        jcenter()
        maven {
            url "https://jitpack.io"
        }
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.0'
        classpath 'com.google.gms:google-services:3.0.0'
        classpath 'com.uphyca.galette:galette-plugin:0.9.15'
    }
}

//noinspection GroovyAssignabilityCheck
android {
    sourceSets {
        main {
            assets.srcDirs = ['assets']
        }
    }
    compileSdkVersion 23
    buildToolsVersion '23.0.2'

    defaultConfig {
        applicationId "com.geecko.QuickLyric"
        resConfigs "ar-rSA", "ca-rES", "cs-rCZ", "de-rBE", "el-rGR", "es-rES", "fa-rIR", "fr-rFR", "hi-rIN", "hu-rHU", "in-rID", "it-rIT", "iw-rIL", "ja-rJP", "pl-rPL", "pt-rBR", "pt-rPT", "ru-rRU", "sl-rSI", "sr-rSP", "sv-rSE", "tr-rTR", "uk-rUA", "vls-rBE", "zh-rCN"
        minSdkVersion 14
        targetSdkVersion 23
        vectorDrawables.useSupportLibrary = true
        versionCode 73
        versionName "2.0 July Preview"
    }
}

dependencies {
    compile 'com.android.support:support-v4:23.+'
    compile 'com.android.support:appcompat-v7:23.+'
    compile 'com.android.support:support-v13:23.+'
    compile 'com.android.support:design:23.+'
    compile 'com.android.support:cardview-v7:23.+'
    compile 'com.android.support:percent:23.+'
    compile 'com.github.medyo:android-about-page:1.0.+'
    compile 'com.balysv:material-ripple:1.0.2'
    compile 'com.android.volley:volley:1.+'
    compile 'org.jraf:android-switch-backport:2.0.1'
    compile 'com.mcxiaoke.viewpagerindicator:library:2.4.1'
    compile 'com.wdullaer:materialdatetimepicker:1.4.2'
    compile 'com.miguelcatalan:materialsearchview:1.4.0'
    compile 'org:jaudiotagger:2.0.3'
    compile 'org.jsoup:jsoup:1.8.+'
    compile 'com.zzhoujay.materialcolors:materialcolors:1.0.0'
    compile 'com.squareup.retrofit:retrofit:1.+'
    compile 'com.squareup.okhttp:okhttp:2.+'
    compile 'com.github.geecko86:SpotifyApi:3'

    /* Debug & testing */
    testCompile 'junit:junit:4.12'
    debugCompile 'com.squareup.leakcanary:leakcanary-android:1.4-beta2'
    releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta2'

    /* Firebase Analytics: PLAY STORE ONLY */
    compile 'com.google.firebase:firebase-ads:9.2.1'
    compile 'com.google.firebase:firebase-crash:9.2.1'
    releaseCompile 'com.google.firebase:firebase-core:9.2.1'
    releaseCompile 'com.google.firebase:firebase-analytics:9.2.1'
}

apply plugin: "com.uphyca.galette"
apply plugin: 'com.google.gms.google-services'

正如您所看到的,所有Google服务内容都设置为9.2.1,我使用的是最新版本的google-services插件。

有什么想法吗?

谢谢!

0 个答案:

没有答案