Runtime JAR file has version 1.4 which is older than required for API version 1.5

今天打包一个项目,突然报个错,让人摸不到问题所在。这个项目是java开发的。

/Users/xxx/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.4.20/9be77b243a362b745e365f286627b8724337009c
/kotlin-stdlib-1.4.20.jar: Runtime JAR file has version 1.4 which is older than required for API version 1.5

w: Runtime JAR files in the classpath have the version 1.4, which is older than the API version 1.5.
Consider using the runtime of version 1.5, or pass '-api-version 1.4' explicitly to restrict
the available APIs to the runtime of version 1.4. You can also pass '-language-version 1.4' instead,
which will restrict not only the APIs to the specified version, but also the language features

看了提示,应该是jar包版本的问题。

但问题肯定出在:

kotlin-stdlib

哪应该如何解决呢?

应该是无意当中用到了kotlin写的包了,所以打包编译的时候,会用到这个依赖,但是没有指定,那只能用系统自带的,但是kotlin已经升级为最新版本。

1、增加classpath : build.gradle(project:xxxx)

 

classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10"

2、增加 dependencies: build.gradle(project:xxxx.app)

implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.6.10'

其中:xxxx您的项目名称。

 

以上二步基本上解决了上面的报错,如果还有报错,看一下提示,解决即可。

在这里,缺少布局中的一个属性没有,默认生成了不同设备的文件导致。

 

 将其它的v24,land,如果用不到,删除就可以解决。

 

posted @   jiduoduo  阅读(2424)  评论(1编辑  收藏  举报
编辑推荐:
· DeepSeek 解答了困扰我五年的技术问题
· 为什么说在企业级应用开发中,后端往往是效率杀手?
· 用 C# 插值字符串处理器写一个 sscanf
· Java 中堆内存和栈内存上的数据分布和特点
· 开发中对象命名的一点思考
阅读排行:
· DeepSeek 解答了困扰我五年的技术问题。时代确实变了!
· PPT革命!DeepSeek+Kimi=N小时工作5分钟完成?
· What?废柴, 还在本地部署DeepSeek吗?Are you kidding?
· DeepSeek企业级部署实战指南:从服务器选型到Dify私有化落地
· 程序员转型AI:行业分析
历史上的今天:
2016-12-22 jquery ajax上传文件
点击右上角即可分享
微信分享提示