[Solved]Some Kotlin libraries attached to this project were complied with a newer Kotlin complier and can't be read


Something wrong has happened when I add a new dependencies.

//My 'build.gradle.kts'
//Same error happened when I try Gradle Groovy DSL
plugins {
    val kotlinVersion = "1.8.10"
    kotlin("jvm") version kotlinVersion
    kotlin("plugin.serialization") version kotlinVersion

    id("net.mamoe.mirai-console") version "2.9.2"
}
var openaiVersion = "3.0.0-beta01"
repositories {
    maven("https://repo.maven.apache.org/maven2")
    mavenCentral()
}
dependencies{
    implementation("com.aallam.openai:openai-client:${openaiVersion}")
    implementation("io.ktor:ktor-client-okhttp:2.2.3")
}


I have update Kotlin plugin version and Kotlin version into latest version.

The dependency is openai-kotlin library on Github.

I search this question on Google, but it doesn’t work. I found nothing useful. Then I submit an issue at Issues page on Github


I try to follow the suggestion form author and change version of my gradle.

More error occurred immediately, when I use gradle 8.0.
Gradle 7.6 can be built successfully.

Starting Gradle Daemon...
Gradle Daemon started in 2 s 986 ms
> Task :prepareKotlinBuildScriptModel UP-TO-DATE
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.6/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 3m 12s

But the error is still happen. The library openai-kotlin cannot be import.
Anyone know how can I solve this problem?
Thanks for your fervent help!

I solved this error by update IDEA software.