我正在尝试运行android的材料设计,同样是从下面的https://github.com/material-components/material-components-android获得的。
但这些错误是:
failed
:lib:packageDebugResources
tokens.xml
Can't determine type for tag '<macro name="m3_comp_bottom_app_bar_container_color">?attr/colorSurface</macro>'
tokens.xml
Can't determine type for tag '<macro name="m3_sys_color_dark_surface_tint">?attr/colorPrimary</macro>'
fab_tokens.xml
Can't determine type for tag '<macro name="m3_comp_fab_primary_container_color">?attr/colorPrimaryContainer</macro>'
tokens.xml
Can't determine type for tag '<macro name="m3_comp_switch_selected_icon_color">?attr/colorOnPrimaryContainer</macro>'
tokens.xml
Can't determine type for tag '<macro name="m3_sys_motion_path">linear</macro>'
tokens.xml
Can't determine type for tag '<macro name="m3_sys_shape_corner_full_family">rounded</macro>'
tokens.xml
Can't determine type for tag '<macro name="m3_ref_typeface_brand_regular">sans-serif</macro>'
/Users/mac/AndroidStudioProjects/material-components-android/lib/java/com/google/android/material/bottomappbar/res/values/tokens.xml: Error: Can't determine type for tag '<macro name="m3_comp_bottom_app_bar_container_color">?attr/colorSurface</macro>'发布于 2022-07-21 05:07:45
在使用android的当前版本(更新为4.2到2021.2.1,并使用了推荐的gradle插件)后,问题得到了解决。
当我为相同的缺陷打开缺陷时,从github获得了以下回复:“您所附加的错误消息表明不识别资源标记,这需要AGP 7.2。您必须在1.7.0-alpha 02之后使用版本,请确保您的应用程序构建具有最低要求的插件版本。”
发布于 2022-09-26 11:47:20
升级到这个版本时,我也遇到了同样的错误。
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.8.0-alpha01'但是工作得很好
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.6.0'发布于 2022-11-02 03:17:23
将Android Gradle插件更新为7.3.3 (gradle-7.3.3-bin.zip)
一切都会好的。
https://stackoverflow.com/questions/73028977
复制相似问题