Never mind, I fixed it :kotlin-intensifies-purple:
# compiler
r
Never mind, I fixed it K
🧵 3
c
Please start posting additional context inside the original question. This way it’s easier to follow and context is not lost when discussion starts.
☝️ 1
r
If you post a question and then work out how to resolve it, it's friendly to post how you resolved it for someone else searching for the solution to the same problem:

https://imgs.xkcd.com/comics/wisdom_of_the_ancients.png

r
Sure, When I fixed it, I just go to sleep, so...., I will give the solution here,
Copy code
kotlin {
    withSourcesJar()
    explicitApi()
    jvm {
        compilerOptions {
            jvmTarget = JvmTarget.JVM_11
            // ✔ Put the arg here
            freeCompilerArgs.add("-Xjvm-default=all")
        }
    }
    mingwX64()
    linuxX64()
    linuxArm64()
    macosX64()
    macosArm64()

    compilerOptions {
        freeCompilerArgs.apply {
            add("-Xexpect-actual-classes")
            // Not here ❌ cause this arg is only for jvm target
            add("-Xjvm-default=all")
        }
    }
}
👀 1