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:
- [Solved] okhttp3 Error: java.lang.NoClassDefFoundError: kotlin/jvm/internal/Intrinsics
- [Solved] idea Run gui Error: Error:Abnormal build process termination:
- [Solved] Android Studio Error: Could not initialize class com.android.sdklib.repository.AndroidSdkHandler
- [Solved] Duplicate class com.blankj.utilcode.BuildConfig found in modules classes.jar
- AS Import Project Error: Plugin with id ‘com.android.application’ not found.
- [Solved] Android Studio Error: Could not initialize class com.android.sdklib.repository.AndroidSdkHandler
- Android studio import project, error e rror:Unsupported method : BaseConfig.getApplicationIdSuffix().
- Flutter: Android dependency ‘com.android.support:support-v4’ has different version …
- IDEA Compile Kotlin Project Error: Cannot inline bytecode buit with JVM target 1.8 into bytecode that is being built with JVM target 1.6.Please specify proper ‘-jvm-target’ option
- Could not find com.android.tools.build:gradle:3.3.0.