错误:无法解析:androidx.appcompat:design:1.1.0

Nag*_*hah 7 java android android-support-library material-components-android androidx

当我'androidx.appcompat:design:1.1.0'在 build gradle(module app) 中实现代码时,它说ERROR: Failed to resolve: androidx.appcompat:design:1.1.0

我尝试更改'androidx.appcompat:appcompat:1.1.0' appscompact 版本中的实现,它再次显示错误

apply plugin: 'com.android.application'

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.2"
    defaultConfig {
        applicationId "com.example.bottomnavigation"
        minSdkVersion 15
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.appcompat:design:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
Run Code Online (Sandbox Code Playgroud)

错误:无法解决:androidx.appcompat:design:1.1.0 显示在项目结构对话框中受影响的模块:app

Nil*_*hod 4

给你Design Support Library需要androidx使用的

用这个

implementation 'com.google.android.material:material:1.0.0'
Run Code Online (Sandbox Code Playgroud)

代替

implementation 'androidx.appcompat:design:1.1.0'
Run Code Online (Sandbox Code Playgroud)