打包要求 minCompileSdk 使用指定版本及以上

我当前的 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 的版本!

Google Android core-ktx

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'
    }
相关推荐
杉氧20 小时前
100% Kotlin:基于 KMP + Compose Multiplatform 的全栈架构实战(Clean Architecture + MVI)
android·架构
小仙女喂得猪20 小时前
AI 写 Android 代码老翻车?我把移动端的 Harness 系统开源了
android·github·ai编程
杉氧20 小时前
第一篇:从一个 Dagger 报错开始:手把手带你搭建 Hilt 依赖注入的护城河
android·架构
咋吃都不胖lyh20 小时前
短期记忆和长期记忆都存 MySQL
android·java·开发语言
杊页1 天前
系列三:组件化与模块化进阶 | 第8篇 组件化与模块化核心实战区别:大型项目架构的必由之路
android·android jetpack
曲幽1 天前
旧手机别扔!用 Termux 搭个私人云盘,比网盘香多了
android·termux·alist·filebrowser
Kapaseker1 天前
Android 开发来看看 Kotlin 2.4.0 更新了个啥
android·kotlin
前端与小赵1 天前
快速生成安卓证书并打包生成安卓apk(保姆教程)
android·前端
吃螺丝粉1 天前
MySQL 5.7 到 9.7.0 LTS 升级核心指南
android