https://kotlinlang.org logo
#getting-started
Title
# getting-started
u

ushort

04/16/2021, 8:33 PM
Need help with compiling on IJ. I have gradle setup where module b implements/depends on module a. I imported a class from module a inside module b and gradle builds fine and IJ editor picks it up. But as soon as I try delegating build to IntelliJ, it throws compilation error, unable to resolve the import of class from module a. I checked dependencies for module b inside Project Structure -> Modules and module a was indeed there. Everything checks out but just can't build. Currently using IntelliJ 2020.3.3, IntelliJ Kotlin Plugin 203-1.4.32-release-IJ7148.5, and kotlin gradle plugin/stdlib 1.4.32
After performing
./gradlew clean build
I actually get this error
Copy code
e: Error processing script definition class com.example.TestScript: Unable to construct script definition: Unable to load base class kotlin.script.experimental.api.KotlinType@2cf00ede
classpath:
    /usr/lib/jvm/java-8-openjdk/jre/lib/management-agent.jar
/usr/lib/jvm/java-8-openjdk/jre/lib/rt.jar
/usr/lib/jvm/java-8-openjdk/jre/lib/jce.jar
/usr/lib/jvm/java-8-openjdk/jre/lib/jfxswt.jar
/usr/lib/jvm/java-8-openjdk/jre/lib/jsse.jar
/usr/lib/jvm/java-8-openjdk/jre/lib/resources.jar
/usr/lib/jvm/java-8-openjdk/jre/lib/jfr.jar
/usr/lib/jvm/java-8-openjdk/jre/lib/charsets.jar
/usr/lib/jvm/java-8-openjdk/jre/lib/ext/jfxrt.jar
/usr/lib/jvm/java-8-openjdk/jre/lib/ext/localedata.jar
/usr/lib/jvm/java-8-openjdk/jre/lib/ext/cldrdata.jar
/usr/lib/jvm/java-8-openjdk/jre/lib/ext/sunec.jar
/usr/lib/jvm/java-8-openjdk/jre/lib/ext/nashorn.jar
/usr/lib/jvm/java-8-openjdk/jre/lib/ext/jaccess.jar
/usr/lib/jvm/java-8-openjdk/jre/lib/ext/zipfs.jar
/usr/lib/jvm/java-8-openjdk/jre/lib/ext/sunjce_provider.jar
/usr/lib/jvm/java-8-openjdk/jre/lib/ext/sunpkcs11.jar
/usr/lib/jvm/java-8-openjdk/jre/lib/ext/dnsns.jar
/home/chris/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.4.32/3302f9ec8a5c1ed220781dbd37770072549bd333/kotlin-stdlib-jdk8-1.4.32.jar
/home/chris/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-scripting-common/1.4.32/6abda0fe69677f0e46e7539fd185e4bd093b7258/kotlin-scripting-common-1.4.32.jar
/home/chris/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-script-runtime/1.4.32/bac50b0748be017dbc13fc1cb7231b1c9da0e106/kotlin-script-runtime-1.4.32.jar
/home/chris/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.4.32/3546900a3ebff0c43f31190baf87a9220e37b7ea/kotlin-stdlib-jdk7-1.4.32.jar
/home/chris/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-core/1.3.8/f62be6d4cbf27781c2969867b4ed952f38378492/kotlinx-coroutines-core-1.3.8.jar
/home/chris/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.4.32/461367948840adbb0839c51d91ed74ef4a9ccb52/kotlin-stdlib-1.4.32.jar
/home/chris/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.4.32/ef50bfa2c0491a11dcc35d9822edbfd6170e1ea2/kotlin-stdlib-common-1.4.32.jar
/home/chris/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar
/home/chris/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.4.32/3302f9ec8a5c1ed220781dbd37770072549bd333/kotlin-stdlib-jdk8-1.4.32.jar
/home/chris/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-scripting-common/1.4.32/6abda0fe69677f0e46e7539fd185e4bd093b7258/kotlin-scripting-common-1.4.32.jar
/home/chris/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-script-runtime/1.4.32/bac50b0748be017dbc13fc1cb7231b1c9da0e106/kotlin-script-runtime-1.4.32.jar
/home/chris/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.4.32/3546900a3ebff0c43f31190baf87a9220e37b7ea/kotlin-stdlib-jdk7-1.4.32.jar
/home/chris/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-core/1.3.8/f62be6d4cbf27781c2969867b4ed952f38378492/kotlinx-coroutines-core-1.3.8.jar
/home/chris/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.4.32/461367948840adbb0839c51d91ed74ef4a9ccb52/kotlin-stdlib-1.4.32.jar
/home/chris/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.4.32/ef50bfa2c0491a11dcc35d9822edbfd6170e1ea2/kotlin-stdlib-common-1.4.32.jar
/home/chris/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar
I was trying to setup a custom kotlin script definition. It says
Unable to load base class kotlin.script.experimental.api.KotlinType@2cf00ede
Oddly enough KotlinType is a class inside kotlin-scripting-common which appears in classpath. Is it because its showing up twice?
4 Views