【Android】kotlin jdk版本冲突与Kotlin依赖管理插件

1、androidx.activity:activity:1.8.0 依赖版本错误问题

*依赖项“androidx.activity:activity:1.8.0”要求依赖它的库和应用针对版本 34 或更高版本 Android API 进行编译。:app 目前是针对 android-33 编译的。此外,Android Gradle 插件 7.3.0 的最大推荐编译 SDK 版本为 33。*

19 issues were found when checking AAR metadata:
​1.  Dependency 'androidx.activity:activity-ktx:1.8.0' requires libraries and applications thatdepend on it to compile against version 34 or later of theAndroid APIs.
​:app is currently compiled against android-32.
​Also, the maximum recommended compile SDK version for Android Gradleplugin 7.4.2 is 33.
​Recommended action: Update this project's version of the Android Gradleplugin to one that supports 34, then update this project to usecompileSdkVerion of at least 34.
​Note that updating a library or application's compileSdkVersion (whichallows newer APIs to be used) can be done separately from updatingtargetSdkVersion (which opts the app in to new runtime behavior) andminSdkVersion (which determines which devices the app can be installedon).
​2.  Dependency 'androidx.activity:activity:1.8.0' requires libraries and applications thatdepend on it to compile against version 34 or later of theAndroid APIs.
​:app is currently compiled against android-32.
​Also, the maximum recommended compile SDK version for Android Gradleplugin 7.4.2 is 33.
​Recommended action: Update this project's version of the Android Gradleplugin to one that supports 34, then update this project to usecompileSdkVerion of at least 34.
​Note that updating a library or application's compileSdkVersion (whichallows newer APIs to be used) can be done separately from updatingtargetSdkVersion (which opts the app in to new runtime behavior) andminSdkVersion (which determines which devices the app can be installedon).
​3.  Dependency 'androidx.savedstate:savedstate-ktx:1.2.1' requires libraries and applications thatdepend on it to compile against version 33 or later of theAndroid APIs.
​:app is currently compiled against android-32.
​Recommended action: Update this project to use a newer compileSdkVersionof at least 33, for example 33.
​Note that updating a library or application's compileSdkVersion (whichallows newer APIs to be used) can be done separately from updatingtargetSdkVersion (which opts the app in to new runtime behavior) andminSdkVersion (which determines which devices the app can be installedon).
​4.  Dependency 'androidx.savedstate:savedstate:1.2.1' requires libraries and applications thatdepend on it to compile against version 33 or later of theAndroid APIs.
​:app is currently compiled against android-32.
​Recommended action: Update this project to use a newer compileSdkVersionof at least 33, for example 33.
​Note that updating a library or application's compileSdkVersion (whichallows newer APIs to be used) can be done separately from updatingtargetSdkVersion (which opts the app in to new runtime behavior) andminSdkVersion (which determines which devices the app can be installedon).
​5.  Dependency 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1' requires libraries and applications thatdepend on it to compile against version 33 or later of theAndroid APIs.
​:app is currently compiled against android-32.
​Recommended action: Update this project to use a newer compileSdkVersionof at least 33, for example 33.
​Note that updating a library or application's compileSdkVersion (whichallows newer APIs to be used) can be done separately from updatingtargetSdkVersion (which opts the app in to new runtime behavior) andminSdkVersion (which determines which devices the app can be installedon).
​6.  Dependency 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1' requires libraries and applications thatdepend on it to compile against version 33 or later of theAndroid APIs.
​:app is currently compiled against android-32.
​Recommended action: Update this project to use a newer compileSdkVersionof at least 33, for example 33.
​Note that updating a library or application's compileSdkVersion (whichallows newer APIs to be used) can be done separately from updatingtargetSdkVersion (which opts the app in to new runtime behavior) andminSdkVersion (which determines which devices the app can be installedon).
​...................................
​19.  Dependency 'androidx.annotation:annotation-experimental:1.3.0' requires libraries and applications thatdepend on it to compile against version 33 or later of theAndroid APIs.
​:app is currently compiled against android-32.
​Recommended action: Update this project to use a newer compileSdkVersionof at least 33, for example 33.
​Note that updating a library or application's compileSdkVersion (whichallows newer APIs to be used) can be done separately from updatingtargetSdkVersion (which opts the app in to new runtime behavior) andminSdkVersion (which determines which devices the app can be installedon).

解决方式:升级编译后的sdk版本

compileSdktargetSdk 设置为34或者更高版本

以上内容已经解决了,您的问题,下面内容可忽略!!!

以上内容已经解决了,您的问题,下面内容可忽略!!!

以上内容已经解决了,您的问题,下面内容可忽略!!!

2、 Kotlin 相关依赖库的版本冲突问题

【Android】报错内容 Duplicate class kotlin.random.jdk8.PlatformThreadLocalRandom found in modules jetified-kotlin-stdlib-1.8.22 (org.jetbrains.kotlin:kotlin-stdlib:1.8.22) and jetified-kotlin-stdlib-jdk8-1.6.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21)

解决方式:添加Kotlin依赖管理插件 platform("org.jetbrains.kotlin:kotlin-bom:1.8.0")

implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0"))

项目中引入 Kotlin 的依赖管理插件。其中 platform("org.jetbrains.kotlin:kotlin-bom:1.8.0") 的作用是引入 Kotlin 的 Bill of Materials(BOM),简化了 Kotlin 相关库的版本管理。通过引入 BOM,可以统一管理 Kotlin 相关库的版本,避免版本冲突和简化依赖配置。这样在引入其他 Kotlin 相关库时,可以不指定版本号,直接使用BOM中指定的版本。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://xiahunao.cn/news/3225272.html

如若内容造成侵权/违法违规/事实不符,请联系瞎胡闹网进行投诉反馈,一经查实,立即删除!

相关文章

收银系统源代码-收银端UI风格

智慧新零售收银系统是一套线下线上一体化收银系统,给商户提供含线下收银称重、线上商城、精细化会员管理、ERP进销存、丰富营销活动、移动店务助手等一体化的解决方案。 如Windows版收银(exe安装包)、安卓版收银(apk安装包&#…

LabVIEW平台从离散光子到连续光子的光子计数技术

光子计数技术用于将输入光子数转换为离散脉冲。常见的光子计数器假设光子是离散到达的,记录到来的每一个光子。但是,当两个或多个光子同时到达时,计数器会将其记录为单个脉冲,从而只计数一次。当连续光子到达时,离散光…

Monorepo仓库管理策略之 Lerna

这里写目录标题 前言:一、简介二、新建项目使用安装生成结构 三、复用现有项目执行命令查看包 四、配置package相互引用导入现有的包 五、发布包确定项目版本发布项目添加项目到到git发布包到NPM包发布出错解决方案 五、实例代码 前言: 将大型代码仓库分…

【漏洞复现】通达OA v2017 video_file.php 任意文件下载漏洞

免责声明: 本文内容旨在提供有关特定漏洞或安全漏洞的信息,以帮助用户更好地了解可能存在的风险。公布此类信息的目的在于促进网络安全意识和技术进步,并非出于任何恶意目的。阅读者应该明白,在利用本文提到的漏洞信息或进行相关测…

【鸿蒙学习笔记】Stage模型

官方文档:Stage模型开发概述 目录标题 Stage模型好处Stage模型概念图ContextAbilityStageUIAbility组件和ExtensionAbility组件WindowStage Stage模型-组件模型Stage模型-进程模型Stage模型-ArkTS线程模型和任务模型关于任务模型,我们先来了解一下什么是…

数学建模及国赛

认识数学建模及国赛 认识数学建模 环境类:预测一下明天的气温 实证类: 评价一下政策的优缺点 农业类: 预测一下小麦的产量 财经类: 分析一下理财产品的最优组合 规划类: 土地利用情况进行 合理的划分 力学类&#xf…

RedHat Linux8 修改root管理员账户密码命令

RedHat Linux8 修改root管理员账户密码命令: sudo passwd root RedHat重置root管理员密码: 1. 查看Linux系统版本信息 cat /etc/redhat-release2. 重置密码 2.1 进入内核编辑界面 重启Linux系统并出现引导界面,按下键盘上的e键进入内…

Pyecharts绘制热力图的说明+代码实战

引言 热力图在数据可视化中是一种强大的工具,可以直观地展示数据的分布情况和变化趋势。Pyecharts是一个基于Echarts的Python可视化库,提供了丰富的图表类型,包括热力图。在本文中,我们将深入探讨Pyecharts绘制多种炫酷热力图的参…

12-阿里云单细胞处理-PBMC(by-jmzeng)

scRNA_10X/seurat-v2/sup-patient1-PBMC.Rmd at master jmzeng1314/scRNA_10X (github.com) s04-运行seurat流程处理一万个单细胞转录组数据并自动化出报告_哔哩哔哩_bilibili #section 3已更新#「生信技能树」单细胞公开课2021_哔哩哔哩_bilibili 上传读取数据 可以配置租…

手表名表维修开单系统软件教程,佳易王钟表养护维护保养记录开单软件操作教程

手表名表维修开单系统软件教程,佳易王钟表养护维护保养记录开单软件操作教程 以下软件操作教程以,佳易王钟表养护维修管理系统软件为例说明 软件文件下载可以点击最下方官网卡片——软件下载——试用版软件下载 一、软件程序操作教程 1、佳易王钟表维…

寂静孤独的404页面源码

寂静孤独的404页面源码,灯光闪烁动态效果,源码由HTMLCSSJS组成,记事本打开源码文件可以进行内容文字之类的修改,双击html文件可以本地运行效果,也可以上传到服务器里面,重定向这个界面 寂静孤独的404页面源…

【面试八股总结】面向对象三大特性、虚函数、纯虚函数、虚继承

参考资料:阿秀 一、面向对象三大特性 封装:将数据和代码捆绑在一起,避免外界干扰和不确定性访问 继承:让某种类型对象获得另一个类型对象的属性和方法 多态:同一种事务表现出不同事务的能力,即&#xf…

Git 详解(原理、使用)

git 快速上手请看这篇博客 Git 快速上手 1. 什么是 Git Git 是目前最主流的一个版本控制器,并且是分布式版本控制系统,可以控制电脑上所有格式的文档 版本控制器:记录每次修改以及版本迭代的管理系统 对于文本文件,可以记录每次…

Vue3项目如何使用npm link本地测试组件库

一、组件库操作 1、在组件库项目中先运行npm run lib,其效果如下 2、在组件库项目中在运行npm link,其效果如下 会创建一个全局的软连接指向本地的组件库 二、Vue3项目使用 1、在项目中运行 npm link 组件名称(即:组件库packag…

【PB案例学习笔记】-30动态打开窗口

写在前面 这是PB案例学习笔记系列文章的第30篇,该系列文章适合具有一定PB基础的读者。 通过一个个由浅入深的编程实战案例学习,提高编程技巧,以保证小伙伴们能应付公司的各种开发需求。 文章中设计到的源码,小凡都上传到了gite…

数电基础 - 数制,码制

目录 一. 简介 数制 码制 二. 进制 十进制(Decimal): 二进制(Binary): 八进制(Octal): 十六进制(Hexadecimal): 三. 进制的转…

Go语言---正则表达式

正则表达式是一种进行模式匹配和文本操纵的复杂而又强大的工具。虽然正则表达式比纯粹的文本匹配效率低,但是它却更灵活。按照它的语法规则,只需构造出的匹配模式就能够从原始文本中筛选出几乎任何你想要得到的字符组合。go语言的通过regexp标准包来实现…

外卖商城平台小程序的设计

管理员账户功能包括:系统首页,个人中心,用户管理,商家管理,骑手管理,商品类型管理,商品信息管理,订单信息管理 微信端账号功能包括:系统首页,商品信息&#…

理解负载组电路-EAK负载电路解释

负载组具有安全、可靠、操作方便、使用寿命长等特点。了解控制、冷却和负载元件电路的布局和功能对于理解负载组的运行、为应用选择负载组和维护负载组非常重要。以下各节将描述这些电路。 EAK负荷组运行概述 负载组接收来自电源的电力,将其转换为热量,…

Spring Cloud Alibaba -- 分布式定时任务解决方案(轻量级、快速构建)(ShedLock 、@SchedulerLock )

文章目录 一、 ShedLock简介二、 SchedulerLock三、基于Mysql方式使用步骤1.建表2.引入依赖3.Mysql连接配置4.ScheduledLock配置5.启动类配置6.创建定时任务7.启动多个项目服务进行测试8.SchedulerLock注解说明 四、使用注意事项 一、 ShedLock简介 ShedLock 是一个用于 Java …