1

When I hover over my 'com.android.support:appcompat-v7:28.0.0' in my build.gradle , it says that the support libaries must use the exact same version specifications. I got this error out of no where where after pulling in some files from my repo on github. I first referred to All com.android.support libraries must use the exact same version specification where many of the solutions were posted but after trying many of them, I could not still resolve my issue. I will list the steps below that I took to try to resolve the issue. Any help would be great on this. I will also post my build.gradle below.

steps taken to resolve issue

  1. Sync project with Gradle File
  2. Invalidate caches and Restart
  3. Created a new project and basically copied everything from the one with issues into it

I also added the following code into my build.gradle and it did not work either.

configurations.all {
    resolutionStrategy.eachDependency { 
 DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 
 'com.android.support') {
            if 
  (!requested.name.startsWith("multidex")) {
                details.useVersion '28.0.0'
             }
          }

        }
    }

build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "losdos.help4hire"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE-FIREBASE.txt'
        exclude 'META-INF/NOTICE'
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0 '
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.google.android.gms:play-services-auth:12.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'
    implementation 'com.google.firebase:firebase-core:16.0.4'
    implementation 'com.google.firebase:firebase-database:16.0.3'
    implementation 'com.google.firebase:firebase-firestore:17.1.2'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.firebase:firebase-client-android:2.5.2+'
    implementation 'com.google.firebase:firebase-auth:16.0.5'
}

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

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion '28.0.0 '
            }
        }

    }
}
lets0code
  • 153
  • 3
  • 17
  • 3
    You have a space after the `0` in `com.android.support:design:28.0.0`. Remove it. – TheWanderer Nov 21 '18 at 21:07
  • This is the errors that I am getting now. `Failed to resolve: com.android.support:appcompat-v7:28.0` `Failed to resolve: com.android.support:design:28.0` `Failed to resolve: com.android.support:support-annotations:28.0` `Failed to resolve: com.android.support:support-v4:28.0 ` – lets0code Nov 21 '18 at 21:38
  • 1
    `details.useVersion` has the same issue, with the space after the `0`. – TheWanderer Nov 21 '18 at 22:19
  • Thank you so much @TheWanderer – lets0code Nov 21 '18 at 22:40

0 Answers0