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

Today, I packed a project and suddenly reported an error, which made people unable to touch the problem. This project is developed in 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

After reading the prompt, it should be the jar package version.

But the problem must be:

kotlin-stdlib

How should I solve it?

It should be inadvertently used the package written by kotlin, so the package will use this dependency when compiling, but it is not specified, so I can only use the one that comes with the system, but kotlin has been upgraded to the latest version.

1. Add Classpath: build.Gradle (Project: XXXX)

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

2.Add dependencies: build.gradle(project:xxxx.app)

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

Where: XXXX your project name.

The above two steps basically solve the above error reporting. If there are still errors, take a look at the prompt and solve it.

Here, an attribute in the layout is missing, and files of different devices are generated by default.

If you can’t use other V24 and land, you can delete them.

Similar Posts: