nee*_*ajt 18 android android-studio material3
我正在尝试运行 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>'
Run Code Online (Sandbox Code Playgroud)
Sup*_*tha 28
升级到此版本时出现同样的错误
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.8.0-alpha01'
Run Code Online (Sandbox Code Playgroud)
但工作正常
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.6.0'
Run Code Online (Sandbox Code Playgroud)
nee*_*ajt 11
使用当前版本的android studio(从4.2更新到2021.2.1并使用推荐的gradle插件)后问题得到解决
当我打开相同的缺陷时,收到来自 github 的以下回复“您附加的错误消息说无法识别资源标签,这需要 AGP 7.2。您必须使用高于 1.7.0-alpha02 的版本,请确保您的应用程序使用所需的最低插件版本。”
| 归档时间: |
|
| 查看次数: |
37094 次 |
| 最近记录: |