v11。+请通过更新google-services插件的版本来修复版本冲突

问题描述 投票:-2回答:1

我的build.gradle(模块:app)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.2"
    defaultConfig {
        applicationId "co.balraj.thawedarshan.thawedarshan"
        minSdkVersion 15
        targetSdkVersion 18
        versionCode 2
        versionName "1.1"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
        multiDexEnabled = true
        manifestPlaceholders = [manifestApplicationId: "${applicationId}",
        onesignal_app_id: "7a55b2de-e55d-4c10-8381-7ec71c0edddb",
        onesignal_google_project_number: "347030018851"]
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    //CardView

    //Universal Image Loaader

    compile files('libs/YouTubeAndroidPlayerApi.jar')


    compile 'com.android.support:appcompat-v7:26.+'
    compile 'com.android.support:design:26.+'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.support:recyclerview-v7:26.+'
    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'com.android.support:cardview-v7:26.+'
    compile 'com.android.support:support-vector-drawable:26.+'
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
    compile 'com.android.support:support-v4:26.+'
    compile 'com.google.android.gms:play-services-ads:11.+'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.mcxiaoke.volley:library:1.0.19'
    compile 'com.google.code.gson:gson:2.2.4'
    compile 'com.google.android.gms:play-services:+'
    compile 'com.google.android.gms:play-services-identity:11.+'
    compile 'com.google.android.gms:play-services-gcm:11+'
    compile 'com.google.android.gms:play-services-analytics:11.+'
    compile 'com.google.android.gms:play-services-location:11.+'
    compile 'com.onesignal:OneSignal:2.+@aar'

    testCompile 'junit:junit:4.12'
}

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

错误

信息:Gradle任务[:app:generateDebugSources,:app:generateDebugAndroidTestSources,:app:mockableAndroidJar,:app:prepareDebugUnitTestDependencies]

错误:任务':app:processDebugGoogleServices'的执行失败。

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

android android-gradle
1个回答
0
投票

编译你的代码

dependencies {
    compile 'com.google.android.gms:play-services:+'
}

并删除

compile 'com.google.android.gms:play-services-identity:11.+'
compile 'com.google.android.gms:play-services-gcm:11+'
compile 'com.google.android.gms:play-services-analytics:11.+'
compile 'com.google.android.gms:play-services-location:11.+'

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

它应该工作

检查您是否已将其放入gradle中:

repositories {
    jcenter()
    maven {
        maven { url "https://maven.google.com" }
    }
}
© www.soinside.com 2019 - 2024. All rights reserved.