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

news2024/9/21 0:36:02

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 that
      depend on it to compile against version 34 or later of the
      Android APIs.
​
      :app is currently compiled against android-32.
​
      Also, the maximum recommended compile SDK version for Android Gradle
      plugin 7.4.2 is 33.
​
      Recommended action: Update this project's version of the Android Gradle
      plugin to one that supports 34, then update this project to use
      compileSdkVerion of at least 34.
​
      Note that updating a library or application's compileSdkVersion (which
      allows newer APIs to be used) can be done separately from updating
      targetSdkVersion (which opts the app in to new runtime behavior) and
      minSdkVersion (which determines which devices the app can be installed
      on).
​
  2.  Dependency 'androidx.activity:activity:1.8.0' requires libraries and applications that
      depend on it to compile against version 34 or later of the
      Android APIs.
​
      :app is currently compiled against android-32.
​
      Also, the maximum recommended compile SDK version for Android Gradle
      plugin 7.4.2 is 33.
​
      Recommended action: Update this project's version of the Android Gradle
      plugin to one that supports 34, then update this project to use
      compileSdkVerion of at least 34.
​
      Note that updating a library or application's compileSdkVersion (which
      allows newer APIs to be used) can be done separately from updating
      targetSdkVersion (which opts the app in to new runtime behavior) and
      minSdkVersion (which determines which devices the app can be installed
      on).
​
  3.  Dependency 'androidx.savedstate:savedstate-ktx:1.2.1' requires libraries and applications that
      depend on it to compile against version 33 or later of the
      Android APIs.
​
      :app is currently compiled against android-32.
​
      Recommended action: Update this project to use a newer compileSdkVersion
      of at least 33, for example 33.
​
      Note that updating a library or application's compileSdkVersion (which
      allows newer APIs to be used) can be done separately from updating
      targetSdkVersion (which opts the app in to new runtime behavior) and
      minSdkVersion (which determines which devices the app can be installed
      on).
​
  4.  Dependency 'androidx.savedstate:savedstate:1.2.1' requires libraries and applications that
      depend on it to compile against version 33 or later of the
      Android APIs.
​
      :app is currently compiled against android-32.
​
      Recommended action: Update this project to use a newer compileSdkVersion
      of at least 33, for example 33.
​
      Note that updating a library or application's compileSdkVersion (which
      allows newer APIs to be used) can be done separately from updating
      targetSdkVersion (which opts the app in to new runtime behavior) and
      minSdkVersion (which determines which devices the app can be installed
      on).
​
  5.  Dependency 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1' requires libraries and applications that
      depend on it to compile against version 33 or later of the
      Android APIs.
​
      :app is currently compiled against android-32.
​
      Recommended action: Update this project to use a newer compileSdkVersion
      of at least 33, for example 33.
​
      Note that updating a library or application's compileSdkVersion (which
      allows newer APIs to be used) can be done separately from updating
      targetSdkVersion (which opts the app in to new runtime behavior) and
      minSdkVersion (which determines which devices the app can be installed
      on).
​
  6.  Dependency 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1' requires libraries and applications that
      depend on it to compile against version 33 or later of the
      Android APIs.
​
      :app is currently compiled against android-32.
​
      Recommended action: Update this project to use a newer compileSdkVersion
      of at least 33, for example 33.
​
      Note that updating a library or application's compileSdkVersion (which
      allows newer APIs to be used) can be done separately from updating
      targetSdkVersion (which opts the app in to new runtime behavior) and
      minSdkVersion (which determines which devices the app can be installed
      on).
​
        .......
        .......
        .......
        .......
        .......
​
 19.  Dependency 'androidx.annotation:annotation-experimental:1.3.0' requires libraries and applications that
      depend on it to compile against version 33 or later of the
      Android APIs.
​
      :app is currently compiled against android-32.
​
      Recommended action: Update this project to use a newer compileSdkVersion
      of at least 33, for example 33.
​
      Note that updating a library or application's compileSdkVersion (which
      allows newer APIs to be used) can be done separately from updating
      targetSdkVersion (which opts the app in to new runtime behavior) and
      minSdkVersion (which determines which devices the app can be installed
      on).

解决方式:升级编译后的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://www.coloradmin.cn/o/1925780.html

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

相关文章

QTabWidget、QListWidget、QStackedWidget

The QTabWidget class provides a stack of tabbed widgets. More... The QListWidget class provides an item-based list widget. More... QStringList strlist;strlist<<"系统"<<"外观"<<"截图"<<"贴图"…

FPGA设计之跨时钟域(CDC)设计篇(1)----亚稳态到底是什么?

1、什么是亚稳态? 在数字电路中,如果数据传输时不满足触发器FF的建立时间要求Tsu和保持时间要求Th,就可能产生亚稳态(Metastability),此时触发器的输出端(Q端)在有效时钟沿之后比较长的一段时间都会处于不确定的状态(在0和1之间振荡),而不是等于数据输入端(D端)的…

Java NIO 总结: NIO技术基础回顾

❃博主首页 &#xff1a; 「码到三十五」 &#xff0c;同名公众号 :「码到三十五」&#xff0c;wx号 : 「liwu0213」 ☠博主专栏 &#xff1a; <mysql高手> <elasticsearch高手> <源码解读> <java核心> <面试攻关> ♝博主的话 &#xff1a…

k8s集群新增节点

目前集群状态 如K8S 集群搭建中规划的集群一样 Masternode01node02IP192.168.100.100192.168.100.101192.168.100.102OSCent OS 7.9Cent OS 7.9Cent OS 7.9 目前打算新增节点node03 Masternode01node02node03IP192.168.100.100192.168.100.101192.168.100.102192.168.100.1…

Java核心篇之JVM探秘:对象创建与内存分配机制

系列文章目录 第一章 Java核心篇之JVM探秘&#xff1a;内存模型与管理初探 第二章 Java核心篇之JVM探秘&#xff1a;对象创建与内存分配机制 第三章 Java核心篇之JVM探秘&#xff1a;垃圾回收算法与垃圾收集器 第四章 Java核心篇之JVM调优实战&#xff1a;Arthas工具使用及…

Windows11终端winget配置

一、工具安装 Windows11是自带该工具的&#xff0c;如果wind10&#xff0c;可以找应用商店和GitHub上进行下载。 安装地址使用 winget 工具安装和管理应用程序 | Microsoft Learn 发布地址 Releases microsoft/terminal GitHub 二、无法使用问题排错 在命令行界面出现以…

鸿蒙读取本地文件同步,异步的优化问题

一、问题引入 有这样一个业务场景&#xff0c; 在进入一个新页面前&#xff0c;需要读取本地文件 。 当这个文件比较大时 &#xff0c;会造成加载页面时间过长。 二、 问题讲解 一般在页面的aboutToAppear里&#xff0c;我们会同步读取文件 &#xff0c; 因为页面UI 依赖文件…

sql monitoring 长SQL ASH AWR 都没有 未Commit or export to csv

Duration 4小时&#xff0c; Database Time 22.5&#xff0c; Session Inactive&#xff0c; 1.未Commit原因, 2.慢慢导出成csv文件&#xff1f; How is v$session status INACTIVE and v$sql_monitor status EXECUTING concurrently 2641811 Posts: 8 Jan 11, 2016 6:47P…

【Linux】重定向 | 为什么说”一切皆文件?“

目录 前言 1.文件描述符分配规则 2.dup2 重定向接口 3.重定向 3.1>输出重定向 3.2>>追加重定向 3.3<输入重定向 3.4 shell 模拟实现< > 3.5 理解> 4. 理解“Linux 下一切皆文件” 前言 问&#xff1a;fd 为什么默认从 3 开始&#xff0c;而不是…

手机怎么用代理ip上网

在数字化时代&#xff0c;网络已经成为我们生活中不可或缺的一部分。然而&#xff0c;有时候出于安全、隐私或访问特定网络资源的需要&#xff0c;我们可能需要使用代理IP来上网。那么&#xff0c;什么是代理IP&#xff1f;如何在手机上设置并使用它呢&#xff1f;本文将为您详…

聚观早报 | 网宿科技推出边缘AI网关;AMD再收购AI公司

聚观早报每日整理最值得关注的行业重点事件&#xff0c;帮助大家及时了解最新行业动态&#xff0c;每日读报&#xff0c;就读聚观365资讯简报。 整理丨Cutie 7月12日消息 网宿科技推出边缘AI网关 AMD再收购AI公司 谷歌Pixel 9系列将配超声波指纹 三星Galaxy Z Fold6亮相 …

如何写论文的讨论和结论部分,提升审稿通过率300%?(附例句模版)

我是娜姐 迪娜学姐 &#xff0c;一个SCI医学期刊编辑&#xff0c;探索用AI工具提效论文写作和发表。 关于论文讨论Discussion部分的撰写&#xff0c;娜姐之前写过几篇文章&#xff1a; 1 Discussion讨论部分被3个审稿人说没深度没逻辑&#xff0c;用这个AI工具三步拯救了我&am…

前端插槽简易版详解【适合有点基础但是有点迷糊的同学查阅】

简易版默认插槽 默认插槽也有自己的名字 效果&#xff1a; 具名插槽 简写 萝卜坑可以种组件哦 插槽传值&#xff1a;父组件用scope接收---变成一个对象

udp协议模拟远程输入指令控制xshell

不了解udp协议的可以先看一下udp协议下的socket函数_udp socket函数-CSDN博客 我之前还写过模拟实现xshell的模拟实现简单的shell-CSDN博客 如今我们要模拟的是让别人连网络连到我们主机&#xff0c;他可以执行命令&#xff1a; 1.接口 我们之前是用execl系列的函数来实现的…

【Android】Service介绍和生命周期

人不走空 &#x1f308;个人主页&#xff1a;人不走空 &#x1f496;系列专栏&#xff1a;算法专题 ⏰诗词歌赋&#xff1a;斯是陋室&#xff0c;惟吾德馨 介绍 Service是Android程序中四大基础组件之一&#xff0c;它和Activity一样都是Context的子类&#xff0c;只不…

强化学习的数学原理(1)

基本概念 State:在下面的例子中就是指每个位置&#xff08;location&#xff09;&#xff0c;例如s1、s2、s3…就是一个State&#xff0c;所有State的集合就是State Space(集合空间 S { s1,s2,s3,s4,s5…,s9 }) Action:每个状态可采取的行动&#xff0c;就如下面图片的例子&a…

openEuler 安装 podman 和 podman compose

在 openEuler 22.03 LTS SP4 中&#xff0c;你可以使用 dnf 包管理器来安装 Podman 和 Podman Compose。openEuler 默认使用 dnf 作为包管理器&#xff0c;所以这是安装软件的首选方式。 关于 openEuler 22.03 LTS SP4 下载地址&#xff1a; https://www.openeuler.org/zh/dow…

昇思MindSpore 25天学习打卡营|day20

GAN图像生成 模型简介 生成式对抗网络(Generative Adversarial Networks&#xff0c;GAN)是一种生成式机器学习模型&#xff0c;是近年来复杂分布上无监督学习最具前景的方法之一。 最初&#xff0c;GAN由Ian J. Goodfellow于2014年发明&#xff0c;并在论文Generative Adve…

Java中HashMap详解:hash原理、扩容机制、线程不安全及源码分析

前言 HashMap 是 Java 中常用的数据结构之一&#xff0c;用于存储键值对。在 HashMap 中&#xff0c;每个键都映射到一个唯一的值&#xff0c;可以通过键来快速访问对应的值&#xff0c;算法时间复杂度可以达到 O(1)。 HashMap 的实现原理是基于哈希表的&#xff0c;它的底层是…

Java语言程序设计——篇四(1)

类和对象 面向对象概述面向过程与面向对象面向对象基本概念面向对象的基本特征面向对象的优势及应用 为对象定义类类的修饰符成员变量成员变量-修饰符 构造方法⭐️成员方法成员方法-修饰符例题讲解 ⚠️理解栈和堆 面向对象概述 两种程序设计方法 结构化程序设计&#xff0c…