在使用Android Studio编译项目时,发现的编译问题。已解决,在此记录一下
问题1
Can't determine type for tag '<macro name="m3_comp_bottom_app_bar_container_color">?attr/colorSurface</macro>'

原因是androidx.appcompat:appcompat和com.google.android.material:material资源冲突
出问题的是app/build.gradle的dependencies
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.7

文章描述了在使用Gradle编译项目时遇到的两个问题:一是无法确定类型错误,由于androidx.appcompat:appcompat和com.google.android.material:material之间的资源冲突;二是ClassNotFoundException。这两个问题都与依赖库的版本有关。解决方案是尝试更换不同版本的appcompat和material库,例如使用1.4.0或1.5.0版本的组合,然后进行sync、clean和assemble操作以成功编译项目。
最低0.47元/天 解锁文章
1006

被折叠的 条评论
为什么被折叠?



