语法突出显示功能在以下时间起作用:删除〜/.gradle/caches 删除〜/Library/Application \ Support/Library/JetBrains/IntelliJIdea2020.3 删除< project dir>/.gradle 删除< project dir>/.idea 启动IDEA并重新导入项目.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 triedhttps://github.com/gradle/kotlin-dsl-samples/issues/1308Changing gradle executable to gradle-kotlin-dsl-5.2-20190122225509+0000-all.ziphttps://youtrack.jetbrains.com/issue/KT-38296Remove empty SDKs in Project structure dialogInvalidate caches and restartReinstalling Java 11 brew install java11Switching to official oracle JDK 15 brew install oracle-jdkhttps://youtrack.jetbrains.com/issue/KT-41141Re-adding SDKs in the SDK menuAdding /Kotlin/kotlinc/lib to Kotlin SDK's classpathhttp://youtrack.jetbrains.com/issue/IDEA-245027Deleting the cache folder manuallySystemIntelliJ IDEA 2020.3.1 (Ultimate Edition)Build #IU-203.6682.168, built on December 29, 2020Licensed to Hykilpikonna GuiSubscription is active until November 28, 2021.For educational use only.Runtime version: 11.0.9.1+11-b1145.63 x86_64VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.macOS 10.15.7GC: ParNew, ConcurrentMarkSweepMemory: 1998MCores: 6Registry: debugger.watches.in.variables=false, js.debugger.webconsole=falseNon-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 解决方案 Answer credit to @AlexeyBelkov - Answered here: https://youtrack.jetbrains.com/issue/KTIJ-893The syntax highlighting feature worked after:Delete ~/.gradle/cachesDelete ~/Library/Application\ Support/Library/JetBrains/IntelliJIdea2020.3Delete <project dir>/.gradleDelete <project dir>/.ideaStart IDEA and reimport the project. 这篇关于无法访问脚本基类'org.gradle.kotlin.dsl.KotlinBuildScript'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 09-06 04:46