zoukankan      html  css  js  c++  java
  • 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,如果用不到,删除就可以解决。

    道法自然
  • 相关阅读:
    「题解」洛谷 P1731 [NOI1999]生日蛋糕
    「题解」洛谷 P1063 能量项链
    Log4j2笔记
    基数排序
    会计知识
    归并排序
    CF668 题解
    拉格朗日反演
    [国家集训队]数颜色 / 维护队列 「带修莫队」
    简单的填数「贪心」
  • 原文地址:https://www.cnblogs.com/jiduoduo/p/15720678.html
Copyright © 2011-2022 走看看