問題
/.gradle/caches/transforms-3/92cd17329ac6b486798490110934dc61/transformed/material-1.9.0/res/values/values.xml: Resource and asset merger: Can't determine type for tag '<macro name="m3_comp_assist_chip_container_shape">?attr/shapeAppearanceCornerSmall</macro>'
代碼中依賴版本
public static String appcompat = "androidx.appcompat:appcompat:1.6.1";
public static String material = "com.google.android.material:material:1.9.0";
Android gradle 插件版本
plugins {
id 'com.android.application' version '7.0.2' apply false
id 'com.android.library' version '7.0.2' apply false
}
原因
gradle 插件和依賴組件版本不一致導(dǎo)致的
解決方案
- 方法一缩擂、降低版本依賴組件版本
public static String appcompat = "androidx.appcompat:appcompat:1.4.1";
public static String material = "com.google.android.material:material:1.6.0";
- 方法二胯盯、升級 android gradle插件及關(guān)聯(lián)配置
在根build.gradle 中更改如下
plugins {
id 'com.android.application' version '7.2.2' apply false
id 'com.android.library' version '7.2.2' apply false
}
gradle-wrapper.properties
#Tue May 30 21:07:37 CST 2023
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME