0

i've a problem inside the "build.gradle" (Module: app) file inside my Android studio project. when i add this line:

implementation 'com.google.android.gms:play-services-ads:15.0.1'

i receive an error on this line:

implementation 'com.android.support:appcompat-v7:27.1.1'

the error is:

All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 27.1.1, 26.1.0. Examples include com.android.support:animated-vector-drawable:27.1.1 and com.android.support:customtabs:26.1.0 less... (Ctrl+1) 
There are some combinations of libraries, or tools and libraries, that are incompatible, or can lead to bugs. One such incompatibility is compiling with a version of the Android support libraries that is not the latest version (or in particular, a version lower than your targetSdkVersion)

this is the code source of my build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "dea1993.morsetorch"
        minSdkVersion 23
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    implementation 'com.google.android.gms:play-services-ads:15.0.1'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
Zoe
  • 27,060
  • 21
  • 118
  • 148
Dea1993
  • 11
  • Try to downgrade `play-services-ads` on `15.0.0` – Yupi May 17 '18 at 12:14
  • if i set `com.google.android.gms:play-services-ads:15.0.0` i receive the same error. instead if i set `implementation 'com.android.support:appcompat-v7:26.1.0'` and `targetSdkVersion 26` and `compileSdkVersion 26` (with ads:15.0.1), the problem disappear – Dea1993 May 17 '18 at 12:32

0 Answers0