Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
685 views
in Technique[技术] by (71.8m points)

java - IDEA - Cannot access script base class 'org.gradle.kotlin.dsl.KotlinBuildScript'

When I create an empty project with Gradle Kotlin DSL, even without any modifications, it would prompt Cannot access script base class 'org.gradle.kotlin.dsl.KotlinBuildScript'. Check your module classpath for missing or conflicting dependencies The project can run, but the syntax highlighting and autocompletion for build.gradle.kts don't work.

What I've tried

System

IntelliJ IDEA 2020.3.1 (Ultimate Edition)
Build #IU-203.6682.168, built on December 29, 2020
Licensed to Hykilpikonna Gui
Subscription is active until November 28, 2021.
For educational use only.
Runtime version: 11.0.9.1+11-b1145.63 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 10.15.7
GC: ParNew, ConcurrentMarkSweep
Memory: 1998M
Cores: 6
Registry: debugger.watches.in.variables=false, js.debugger.webconsole=false
Non-Bundled Plugins: CMD Support, Rider UI Theme Pack, Statistic, com.alayouni.ansiHighlight, com.intellij.ideolog, net.vektah.codeglance, String Manipulation, com.alibaba.p3c.smartfox, wu.seal.tool.jsontokotlin, com.demonwav.minecraft-dev, lermitage.intellij.extra.icons, com.github.masahirosuzuka.PhoneGapIntelliJPlugin, Dart, io.flutter, deno, org.jetbrains.kotlin, com.cybrosis.catdea, siosio.kodkod, izhangzhihao.rainbow.brackets, org.jetbrains.plugins.ruby, Pythonid, org.jetbrains.plugins.vue, tv.twelvetone.intellij.plugins.intellivue, ru.meanmail.plugin.requirements
question from:https://stackoverflow.com/questions/65645510/idea-cannot-access-script-base-class-org-gradle-kotlin-dsl-kotlinbuildscript

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Answer credit to @AlexeyBelkov - Answered here: https://youtrack.jetbrains.com/issue/KTIJ-893

The syntax highlighting feature worked after:

  1. Delete ~/.gradle/caches
  2. Delete ~/Library/Application Support/Library/JetBrains/IntelliJIdea2020.3
  3. Delete <project dir>/.gradle
  4. Delete <project dir>/.idea
  5. Start IDEA and reimport the project.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...