Appcompat-v7: 25.2.0 Game services conflicts: 10.2.1

I am working on a new application. I am currently trying to add a dependency

compile 'com.google.android.gms:play-services:10.2.1'

      

When I get gradle compile error on compile 'com.android.support:appcompat-v7:25.2.0'

saying:

All com.android.support libraries must use the same version (mixing versions may crash while running). Found version 25.2.0, 24.0.0. Examples include com.android.support:animated-vector-drawable:25.2.0 and com.android.support:mediarouter-v7:24.0.0 less ... (⌘F1) There are some combinations of libraries or tools and libraries that are incompatible or may lead to errors. One such incompatibility is compiling with a version of the Android Support Libraries that is not the latest version (or specifically a version below your targetSdkVersion.)

What are the best ideas to solve this problem?

Gradle file

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    defaultConfig {
        applicationId "appIdhere"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        resValue "string", "authority", "${applicationId}"
    }
    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'
    })

    provided "org.projectlombok:lombok:1.16.8"
    compile 'com.android.support:appcompat-v7:25.2.0'
    compile 'com.android.support:design:25.2.0'
    compile 'com.android.support:recyclerview-v7:25.2.0'
    compile 'com.android.support:cardview-v7:25.2.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.support:support-v4:25.2.0'
    compile 'com.squareup.okhttp:okhttp:2.7.0'
    compile 'com.google.android.gms:play-services:10.2.1'
    testCompile 'junit:junit:4.12'
}

      

+3


source to share


3 answers


Update your build.gradle file as follows:



compile 'com.android.support:appcompat-v7:25.3.1'

+4


source


you → Compile 'com.android.support:mediarouter-v7:#version'



enter image description here

+4


source


You should replace the following line in your build.gradle file:

compile 'com.google.android.gms:play-services:10.2.1'

      

with these lines

compile 'com.google.android.gms:play-services-fitness:10.2.1'
compile 'com.google.android.gms:play-services-wearable:10.2.1'

      

you can also add these lines as per your requirement

//for Google+
compile 'com.google.android.gms:play-services-plus:10.2.1'
//for Google Account Login
compile 'com.google.android.gms:play-services-auth:10.2.1'

      

For reference, you should follow [ https://developers.google.com/android/guides/setup]

0


source







All Articles