spotlessGroovyGradleCheck FAILED

Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:spotlessGroovyGradleCheck’.

The following files had format violations:
build.gradle
@@ -1,8 +1,8 @@
pluginsÀ{
ÀÀÀÀidÀ"java"
ÀÀÀÀidÀ"edu.wpi.first.GradleRIO"ÀversionÀ"2023.4.3"
-ÀÀÀidÀ"com.diffplug.spotless"ÀversionÀ"6.1.0"
-ÀÀ//ÀidÀ"com.diffplug.gradle.spotless"ÀversionÀ"6.22.0"
+ÀÀÀÀidÀ"com.diffplug.spotless"ÀversionÀ"6.1.0"
+ÀÀÀÀ//ÀidÀ"com.diffplug.gradle.spotless"ÀversionÀ"6.22.0"
}

       sourceCompatibilityÀ=ÀJavaVersion.VERSION_11
      @@ -129,5 +129,5 @@
       ÀÀÀÀÀÀÀÀindentWithSpaces(2)
       ÀÀÀÀÀÀÀÀendWithNewline()
       ÀÀÀÀ}
      -ÀÀÀÀ
      +
       }
  settings.gradle
      @@ -1,27 +1,27 @@
      -import org.gradle.internal.os.OperatingSystem\n
      -\n
      -pluginManagement {\n
      -    repositories {\n
      -        mavenLocal()\n
      -        gradlePluginPortal()\n
      -        String frcYear = '2023'\n
      -        File frcHome\n
      -        if (OperatingSystem.current().isWindows()) {\n
      -            String publicFolder = System.getenv('PUBLIC')\n
      -            if (publicFolder == null) {\n
      -                publicFolder = "C:\\Users\\Public"\n
      -            }\n
      -            def homeRoot = new File(publicFolder, "wpilib")\n
      -            frcHome = new File(homeRoot, frcYear)\n
      -        } else {\n
      -            def userFolder = System.getProperty("user.home")\n
      -            def homeRoot = new File(userFolder, "wpilib")\n
      -            frcHome = new File(homeRoot, frcYear)\n
      -        }\n
      -        def frcHomeMaven = new File(frcHome, 'maven')\n
      -        maven {\n
      -            name 'frcHome'\n
      -            url frcHomeMaven\n
      -        }\n
      -    }\n
      -}\n
      +import org.gradle.internal.os.OperatingSystem\r\n
      +\r\n
  ... (25 more lines that didn't fit)

Run ‘gradlew.bat :spotlessApply’ to fix these violations.

how can i fix it. pls help

The final line is the answer. At the command prompt run .\gradlew spotlessApply.

How can i Run it?

Open the terminal in visual studio code and type the command into the terminal window.

I run “.\gradlew spotlessApply” command in terminal but I take eror

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:spotlessJava’.

java.lang.reflect.InvocationTargetException

What’s going on with the spaces? (Encoding issues?)

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.