【问题标题】:ERROR: Failed to resolve: androidx.appcompat:design:1.1.0错误:无法解决:androidx.appcompat:design:1.1.0
【发布时间】:2020-01-17 06:51:03
【问题描述】:

当我在构建 gradle(模块应用程序)中实现 'androidx.appcompat:design:1.1.0' 代码时 它说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'
}

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

【问题讨论】:

  • androidx.appcompat:design:1.1.0 不存在

标签: java android android-support-library androidx material-components-android


【解决方案1】:

给你Design Support Libraryandroidx你需要使用

使用这个

implementation 'com.google.android.material:material:1.0.0'

代替

implementation 'androidx.appcompat:design:1.1.0'

【讨论】:

    【解决方案2】:

    androidx.appcompat:design不存在

    查看artifact mapping

    com.android.support:design  ->  com.google.android.material:material:1.0.0
    

    您可以找到材料组件库的here the documentation

    【讨论】:

      【解决方案3】:

      为了消除错误,

      而不是这个:

      implementation 'androidx.appcompat:design:1.1.0'
      

      这样写:

      implementation 'com.google.android.material:material:1.2.1'
      

      【讨论】:

        猜你喜欢
        • 2018-09-25
        • 2021-12-07
        • 2019-05-11
        • 1970-01-01
        • 1970-01-01
        • 2018-07-17
        • 2018-02-08
        • 2020-01-31
        • 2018-01-05
        相关资源
        最近更新 更多