0

I just included ads into my app and as part of that process I included

/*google play plugin for adMob*/
    compile 'com.google.android.gms:play-services:10.2.1'

as a dependency in my gradle app file. But I'm getting a red underscore error under

compile 'com.android.support:appcompat-v7:26.+'

error says: all com.android.libraries support must use same version specification. mixing can lead to crashes.

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.2"
    defaultConfig {
        applicationId "org.pctechtips.george.dailyquotes"
        minSdkVersion 16
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    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'
        /*firebase */
//        compile 'com.google.firebase:firebase-core:10.2.1'
    })
    //    compile 'com.android.support:appcompat-v7:21.0.3'
    compile 'com.android.support:appcompat-v7:26.+'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.support:support-v4:26.+'
    testCompile 'junit:junit:4.12'
    /*google play plugin for adMob*/
    compile 'com.google.android.gms:play-services:10.2.1'
}
miatech
  • 2,150
  • 8
  • 41
  • 78

1 Answers1

0

play-services-ads:10.2.1 has a dependency onto play-services-basement:10.2.1 which has a dependency onto com.android.support:support-v4:24.0.0. This is likely the source of the mismatch.

See All com.android.support libraries must use the exact same version specification for more context.

zfromg
  • 170
  • 9