Development issue/problem:
Yesterday I updated the Android Studio version and the Kotlin plugin.
Studio version of Android : 3.1.2
Kotlin’s version: 1.2.41
When I create an Android project with this configuration, I get a warning from the Kotlin compiler that says
Modified as suggested, I get the following error.
How can I solve this problem?
Solution 1:
Go to Tools > Kotlin > Configure Kotlin Plugin Updates and search for
-Updates, then replace jre with jdk in your application evaluation file.
implementation.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version
Solution 2:
Important update
The JDK version must be checked before configuring.
The Kotlin ranks configuration page contains detailed information on this subject.
First check your version of Kotlin in the gradle file.
if (kotlin_version == 1.2.x ) (use jdk NOT jre)
First check your jdk version in File > Project structure.
Or visit build.gradle
compileOptions {
sourceJavaVersion.VERSION_1_8
targetJavaVersion.VERSION_1_8
compatibility }
if (jdk_version == 1.8)
implementation.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version
if (jdk_version == 1.7)
implementation.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version
if (jdk_version < 1,7)
implementation.jetbrains.kotlin:kotlin-stdlib:$kotlin_version
otherwise, if (the jdk version is not installed in the project structure)
if(Android_Studio_Version)
Because Android Studio comes with jdk 1.8 as of version 2.2.1.
2. also as ( kotlin_version == ‘1.1.x’) (use jre NOT jdk)
implementationorg.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version // of jre8
Kotlin?version update
You can update the version of Kotlin from the Tools > Kotlin > Configure Kotlin Updates menu.
Solution 3:
Something is temporarily importing these libraries. To find out what depends on Mr. Gradle’s work, just ask around.
In my case it was io.vertx:vertx-lang-kotlin-coroutines:3.5.1.
If there is no update for this addiction, there is nothing you can do about it.
Solution 4:
After reading topic
of the kotlin cradle scenario, I discovered that some doughnuts
If you focus on JDK 7 or JDK 8, you can use extended versions of the standard Kotlin library, which include additional API extensions added in more recent versions of the JDK. Use one of the following dependencies instead of cotlin-stdlib:
compiles org.jetbrains.kotlin:kotlin-stdlib-jdk7
compiles org.jetbrains.kotlin:kotlin-stdlib-jdk8
In my project I used the implementation org.jetbrains.kotlin:kotlin-stdlib-jdk8. I think it’s because of theOptions compilation that’s in build.graddle.
compileOptions {
sourceJavaVersion.VERSION_1_8
targetJavaVersion.VERSION_1_8
compatibility }
Solution No 5:
You must exchange the codes below:
implementation.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version
Pas jre > jdk
implementation.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version
Good luck!
Related Tags:
kotlin-stdlib-jdk7 vs kotlin-stdlib-jdk8,kotlin-stdlib-common vs kotlin-stdlib,kotlin stdlib jdk7 maven,android kotlin-stdlib-jdk8,error: failed to resolve: org jetbrains kotlin kotlin-stdlib-jre7 1.3 10,org jetbrains kotlin kotlin stdlib jdk7 kotlin version,org jetbrains kotlin kotlin-stdlib-jre7:$kotlin_version,org jetbrains kotlin kotlin-stdlib-jdk7 maven