Android Studio 中的任务执行失败任务 ':app:dataBindingMergeDependencyArtifactsDebug' 执行失败

Execution failed for Task in Android Studio Execution failed for task ':app:dataBindingMergeDependencyArtifactsDebug'

我有以下 Gradle 文件 (build.gradle (app))

plugins {

    id 'com.android.application'
}

android {
    compileSdkVersion 30
    buildToolsVersion "28.0.3"

    defaultConfig {
        applicationId "com.example.bslhrms"
        minSdkVersion 16
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            manifestPlaceholders=[usesCleartextTraffic:"false"]
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    buildFeatures {
        viewBinding true
    }
}

dependencies {

    implementation 'com.android.support:support-core-utils-28.0.0'
    implementation 'androidx.appcompat:appcompat:1.3.0'
    implementation 'com.google.android.material:material:1.4.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    implementation 'androidx.lifecycle:lifecycle-livedata-ktx:+'
    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:+'
    implementation 'androidx.navigation:navigation-fragment:2.3.5'
    implementation 'androidx.navigation:navigation-ui:2.3.5'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'


    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:support-v4-28.0.0'

    // Glide image library
    implementation 'com.github.bumptech.glide:glide:3.7.0'

    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'com.squareup.retrofit2:retrofit:2.5.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
}

执行后,出现以下错误

任务“:app:dataBindingMergeDependencyArtifactsDebug”执行失败。

Could not resolve all files for configuration ':app:debugCompileClasspath'. Could not find com.android.support:support-core-utils-28.0.0:. Required by: project :app Could not find com.android.support:appcompat-v7-28.0.0:. Required by: project :app Could not find com.android.support:design-28.0.0:. Required by: project :app Could not find com.android.support:support-v4-28.0.0:. Required by: project :app

可能的解决方案:

任何帮助将不胜感激

可能会失败,因为您混淆了支持兼容库和 androidx 工件。

如果你需要保留 com.android.support:support-core-utils 你需要使用 androidx.legacy:legacy-support-core-utilsArtifacts mapping.

所述

其他人也一样删除所有 com.android.support:appcompat 并使用他们在上面 link 中提到的 AndroidX 的等效工件。

你不需要这 3 个。删除这些

implementation 'com.android.support:appcompat-v7-28.0.0'
implementation 'com.android.support:design-28.0.0'
implementation 'com.android.support:support-v4-28.0.0