
我当前的 compileSdkVersion 30,因为依赖了 androidx.core:core:1.9.0
它要求最低 compileSdkVersion 33。
那么如果我不想升级 compileSdkVersion 应该怎么办?
答:当然是降低 core:core 版本!

看看谁依赖了这两个版本
androidx.core:core:1.9.0
androidx.appcompat:appcompat:1.0.0 间接依赖了,但是被其他因素强制升级依赖 1.9.0
版本

androidx.core:core-ktx:1.9.0
core:core 版本内部依赖了 core-ktx:1.9.0
,所以如何解决呢?

当然是,降低 androidx.core:core
的版本!
groovy
configurations.all{
resolutionStrategy.force 'androidx.core:core:1.0.0'
//起初我是写 core-ktx:1.0.0,但是打包发现没有这个版本,找官方文档也没看到版本记录
//只能以最笨的方法同 1.9.0 逐个降版本进行测试,直到找到一个合适的版本
// 1.9.0 -》 1.8.0 -》 1.7.0 -》 1.6.0 -》 1.5.0 -》》》
resolutionStrategy.force 'androidx.core:core-ktx:1.5.0'
}
