在使用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.0'
问题2
Caused by: java.lang.ClassNotFoundException: com.android.tools.lint.client.api.Vendor
出问题的是app/build.gradle的dependencies
// implementation 'androidx.appcompat:appcompat:1.5.0'
// implementation 'com.google.android.material:material:1.6.0'//或者是implementation 'androidx.appcompat:appcompat:1.5.0'implementation 'com.google.android.material:material:1.5.0'
解决方法
换成其他版本号问题就解决了
如:
//1.4.0版本
// implementation 'androidx.appcompat:appcompat:1.4.0'
// implementation 'com.google.android.material:material:1.4.0'//或者是其他的implementation 'androidx.appcompat:appcompat:1.4.0'implementation 'com.google.android.material:material:1.5.0'//或者implementation 'androidx.appcompat:appcompat:1.4.1'implementation 'com.google.android.material:material:1.5.0'
再次sync、clean、assmble就能编过了