打包要求 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'
    }
相关推荐
码农coding43 分钟前
android 12 中的VSYNC的请求
android
YF02111 小时前
详解Android所有文件访问权限
android
时间的拾荒人2 小时前
MySQL C语言连接 - 从入门到实战
android·c语言·mysql
Meteors.3 小时前
Android性能优化:01. 指标体系 + 分析工具链
android
jike_20264 小时前
安卓平台免费录音转文字工具深度测评:5 款 APP 功能对比与选型指南
android·智能电视
Code Man4 小时前
Windows 下使用 Appium
android·windows·appium
码农coding4 小时前
android 12 中的VSYNC接收
android
GitLqr4 小时前
Flutter 3.44 性能飞跃:深度解析 Android Platform View 的 HCPP 新特性
android·flutter·性能优化
码农coding5 小时前
android 12 SurfaceFlinger中的CompositionEngine
android
Mem0rin6 小时前
[MySQL] 聚合函数、分组查询、连接查询
android·mysql