首页 > 解决方案 > 将材料库更新到 1.1.0 时资源编译失败

问题描述

我已将我的材料库从com.google.android.material:material:1.0.0更新为com.google.android.material:material:1.1.0

更新后我收到以下错误。我找到的唯一解决方案是将其还原为旧版本。

另外,我尝试将每个依赖项更新到最新版本,但这也不起作用。

/home/name/.gradle/caches/transforms-2/files-2.1/03d95e2ec81bf572bcb58974acba7470/material-1.1.0-alpha06/res/values/values.xml:718:5-725:23:AAPT:错误:重复值对于配置为“”的资源“attr/checkedButton”。

添加我的依赖项以供参考:

 // Support libraries
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.1.0'

//Retrofit and ok http
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.9.1'

//Multidex
implementation 'androidx.multidex:multidex:2.0.1'

// Flex
implementation 'com.hopenlib.library:cflextools:1.0.0'
implementation 'com.google.android:flexbox:1.0.0'

// Testing
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

标签: androidandroiddesignsupportmaterial-components

解决方案


如果您在 androidx 中遇到 AAPT 问题,那么如果您的项目在androidx 中,问题可能出现在您的任何布局文件中,那么您可以更新您的设计库。 还要检查所有布局文件,任何资源文件和可绘制文件或 sting 文件可能丢失。

实施 'com.google.android.material:material:1.0.0'


推荐阅读