Android Studio 报错AAPT: error: resource android:attr/lStar not found.解决方法

r\.gradle\caches\transforms-2\files-2.1\930c42acd29d295ce5bc495c3b84423e\core-1.9.0\res\values\values.xml:104:5-113:25: AAPT: error: resource android:attr/lStar not found.

报错提示了 core-1.9.0

这个问题一般是由于 androidx.core 版本不兼容所致

解决方法:
方法1:全局搜索项目 androidx.core:core 或者  androidx.core:core-ktx,若没有设置具体版本的修改为具体版本就好,

方法2:若是第三方库使用没有设置具体版本,在app的build.gradle中添加如下,强制项目使用具体的版本,解决问题

   configurations.all {
            resolutionStrategy {
                //force 'androidx.core:core-ktx:1.6.0'
                force 'androidx.core:core:1.6.0'
            }
        }

或者提高到对应的sdk版本

core-1.9.0 对应  compileSdkVersion 31 修改到此版本 就可以了