12

The red notification bar at the top says: /org/gradle/tooling/BuildException (java.lang.NoClassDefFoundError: /org/gradle/tooling/BuildException. I can run a gradle refresh successfully, I can run the project successfully, but I cannot get that error to go away. I think my project is actually running fine, intellij just can't properly interpret the build.gradle.kts file for whatever reason. Does anybody know what to do? I included an image. Clicking on the red bar does nothing. I can find no more information about the error message anywhere. I'm running the latest intellij EDU.

enter image description here

Sam
  • 401
  • 5
  • 13

3 Answers3

8

Deleting the entire .idea as suggested Luxus would work, but would also be a little bit too extreme.

The problem comes from a misconfigured .idea/workspace.xml, try to find your the part which look like this in the workspace.xml file :

  <component name="StandaloneScriptsStorage">
    <option name="files">
      <set>
        <option value="$PROJECT_DIR$/your_module/build.gradle.kts" />
      </set>
    </option>
  </component>

You'll have to delete the whole <component/> tag, and maybe restart your idea to get rid of the issue.

SebVay
  • 141
  • 1
  • 5
4

just delete .idea folder and restart IntelliJ.

Luxus io
  • 41
  • 2
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 16 '22 at 13:28
0

Looks like https://youtrack.jetbrains.com/issue/KTIJ-20903. Try to update your gradle version.

vanyochek
  • 815
  • 4
  • 10
  • It definitely looks like that. However, I tried changing gradle versions several times with both the gradle wrapper and gradle itself. The error persists. FWIW, I also had IntelliJ set up to use the project wrapper. I tried pointing it at the gradle installed by homebrew and still had the error – Sam Feb 09 '22 at 13:08
  • Please, file an issue https://kotl.in/issue – vanyochek Feb 10 '22 at 14:50