安卓studio编译报错,这个是一个新建的项目就报错,原因是
implementation 'androidx.appcompat:appcompat:1.7.0'版本太高,修改后版本
implementation 'androidx.appcompat:appcompat:1.4.0',
编译又报错
- 18 issues were found when checking AAR metadata:
报错原因是
implementation 'com.google.android.material:material:1.12.0'版本太高导致,修改后端版本
implementation 'com.google.android.material:material:1.8.0'
记录下其他报错
- Duplicate class androidx.lifecycle.ViewModelLazy found in modules lifecycle-viewmodel-2.5.0-runtime (androidx.lifecycle:lifecycle-viewmodel:2.5.0) and lifecycle-viewmodel-ktx-2.3.1-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1)
在model的build.grad配置
configurations {
all {
exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel-ktx'
}
}