Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

400
Visualizações
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

  • https://github.com/gradle/kotlin-dsl-samples/issues/1308
    • Changing gradle executable to gradle-kotlin-dsl-5.2-20190122225509+0000-all.zip
  • https://youtrack.jetbrains.com/issue/KT-38296
    • Remove empty SDKs in Project structure dialog
    • Invalidate caches and restart
  • Reinstalling Java 11 brew install java11
  • Switching to official oracle JDK 15 ​brew install oracle-jdk
  • https://youtrack.jetbrains.com/issue/KT-41141
    • Re-adding SDKs in the SDK menu
    • Adding /Kotlin/kotlinc/lib to Kotlin SDK's classpath
  • http://youtrack.jetbrains.com/issue/IDEA-245027
    • Deleting the cache folder manually

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
over 4 years ago · Santiago Trujillo
8 Respostas
Responde à pergunta

0

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 (or ~/.cache/JetBrains/IntelliJIdea2020.3 for ubuntu/linux users)
  3. Delete <project dir>/.gradle
  4. Delete <project dir>/.idea
  5. Start IDEA and reimport the project.
over 4 years ago · Santiago Trujillo Relatório

0

Worked for me after I'd deleted:

Delete <project dir>/.gradle
Delete <project dir>/.idea
over 4 years ago · Santiago Trujillo Relatório

0

In my case (the OS is Windows 10) it was enough to:

  1. Delete C:\Users\<you>\AppData\Local\JetBrains\IntelliJIdea2021.1\caches
  2. Restart IntelliJ IDEA.
  3. Click "Load Script Configurations" when it appears after re-indexing.

Thanks @MichaelBöckling for a hint!

over 4 years ago · Santiago Trujillo Relatório

0

For IntelliJ 2021.1, I had to delete the caches folder at:
~/Libary/Caches/JetBrains/IntelliJIdea2021.1/caches

over 4 years ago · Santiago Trujillo Relatório

0

I set the project SDK to Kotlin under Project Settings > Modules. I also set the SDK in Plaftorm Settings > SDKs although I don't know if that's required. And just in case I restarted IntelliJ with File > Invalidate Caches / Restart ...

enter image description here

over 4 years ago · Santiago Trujillo Relatório

0

In my case, I had to install the previous IDE version (2021.1.3).

over 4 years ago · Santiago Trujillo Relatório

0

Mac OS:

  1. File -> Project Structure -> SDK Location -> click on Gradle Settings
  2. Modify the Gradle JDK
  3. File -> Invalidate Caches...

enter image description here

enter image description here

over 4 years ago · Santiago Trujillo Relatório

0

Guided Cache Recovery (IntelliJ IDEA 2021.3+)

IntelliJ IDEA versions from 2021.3 and on (as of writing, available from JetBrain's Early Access Program, or EAP) has a featured called "Guided Cache Recovery" (File, Run Guided Cache Recovery...). While I can't find any documentation yet about this feature, it appears to give the user the ability to apply diagnostic/recovery steps, one at a time, to fixing any cache issues.

For me, the problem reported by the OP was resolved at step 2: "Rescan Project Indexes".

The really cool thing about this is that, not only did it fix my problem, but IntelliJ then created an issue report with details about the problem found, and gave me the option of submitting this report to JetBrains via the crash reporter. This tells me that JetBrains appears to be serious about fixing these issues for users, and about resolving their root causes.

Permissions Issues in .idea, .gradle, or gradle

Another possible problem is permissions issues in one of the .idea, .gradle, or gradle directories. For example, running a rootfull docker container, mounting the project as a volume (for example, to run a tool like Qodana) could cause some files to become owned by root unless the appropriate Docker options are used. If this issue is noticed, reset permissions with chmod and chown and then sync again in IDEA.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda