无法解决:com.android.support:design:28.0

时间:2018-11-21 21:03:03

标签: java android android-studio

当我将鼠标悬停在'com.android.support:appcompat-v7:28.0.0'中的build.gradle上时,它表示support libaries must use the exact same version specifications。从github的存储库中提取了一些文件后,我无处不在出现此错误。我首先提到All com.android.support libraries must use the exact same version specification,其中发布了许多解决方案,但是尝试了许多解决方案之后,我仍然无法解决问题。我将在下面列出尝试解决此问题的步骤。任何帮助将对此大有帮助。我还将在下方发布我的build.gradle

steps taken to resolve issue

  1. 使用Gradle File同步项目
  2. 使缓存无效并重新启动
  3. 创建了一个新项目,基本上将所有有问题的项目复制到了该项目中

我还向我的build.gradle中添加了以下代码,该代码也不起作用。

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 '
            }
        }

    }
}

0 个答案:

没有答案