FAILURE: Build failed with an exception

I have a new install that I am unable to build code on. The closest I’ve been able to find to a similar problem is here, but it doesn’t seem to be the exact same problem: Gradle failing to build

I removed all previously installed associated software before installing.

All software is a fresh install with the most recent versions available.

I create a new project using the Timed Robot template. I’ve made no changes to the code.

I’ve been pulling my hair out for 2 days trying to figure this out and I’m making zero progress.

When I try to build code I get the following:

> Executing task: gradlew build   -Dorg.gradle.java.home="C:\Users\Public\wpilib\2022\jdk" <

Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

  • What went wrong:
    Unable to start the daemon process.
    This problem might be caused by incorrect configuration of the daemon.
    For example, an unrecognized jvm option is used.
    Please refer to the User Manual chapter on the daemon at The Gradle Daemon
    Process command line: C:\Users\Public\wpilib\2022\jdk\bin\java.exe --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.invoke=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.prefs/java.util.prefs=ALL-UNNAMED --add-opens java.prefs/java.util.prefs=ALL-UNNAMED --add-opens java.base/java.nio.charset=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.util.concurrent.atomic=ALL-UNNAMED -XX:MaxMetaspaceSize=256m -XX:+HeapDumpOnOutOfMemoryError -Xms256m -Xmx512m -Dfile.encoding=windows-1252 -Duser.country=US -Duser.language=en -Duser.variant -cp C:\Users\LDSS Roboctics.gradle\permwrapper\dists\gradle-7.3.3-bin\6a41zxkdtcxs8rphpq6y0069z\gradle-7.3.3\lib\gradle-launcher-7.3.3.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 7.3.3
    Please read the following process output to find out more:

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not create service of type ClassLoaderRegistry using GlobalScopeServices.createClassLoaderRegistry().

  • Try:

Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

  • Exception is:
    org.gradle.internal.service.ServiceCreationException: Could not create service of type ClassLoaderRegistry using GlobalScopeServices.createClassLoaderRegistry().
    at org.gradle.internal.service.DefaultServiceRegistry$FactoryMethodService.invokeMethod(DefaultServiceRegistry.java:898)
    at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.createServiceInstance(DefaultServiceRegistry.java:823)
    at org.gradle.internal.service.DefaultServiceRegistry$ManagedObjectServiceProvider.getInstance(DefaultServiceRegistry.java:608)
    at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.get(DefaultServiceRegistry.java:671)
    at org.gradle.internal.service.DefaultServiceRegistry.applyConfigureMethod(DefaultServiceRegistry.java:199)
    at org.gradle.internal.service.DefaultServiceRegistry.findProviderMethods(DefaultServiceRegistry.java:181)
    at org.gradle.internal.service.DefaultServiceRegistry.addProvider(DefaultServiceRegistry.java:265)
    at org.gradle.launcher.daemon.server.DaemonServices.(DaemonServices.java:86)
    at org.gradle.launcher.daemon.bootstrap.DaemonMain.doAction(DaemonMain.java:112)
    at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:50)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:60)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:37)
    at org.gradle.launcher.daemon.bootstrap.GradleDaemon.main(GradleDaemon.java:22)
    Caused by: org.gradle.api.UncheckedIOException: Could not load properties for module ‘gradle-java-compiler-plugin’ from C:\Users\LDSS Roboctics.gradle\permwrapper\dists\gradle-7.3.3-bin\6a41zxkdtcxs8rphpq6y0069z\gradle-7.3.3\lib\plugins\gradle-java-compiler-plugin-7.3.3.jar
    at org.gradle.api.internal.classpath.DefaultModuleRegistry.loadModuleProperties(DefaultModuleRegistry.java:268)
    at org.gradle.api.internal.classpath.DefaultModuleRegistry.loadOptionalModule(DefaultModuleRegistry.java:153)
    at org.gradle.api.internal.classpath.DefaultModuleRegistry.loadModule(DefaultModuleRegistry.java:138)
    at org.gradle.api.internal.classpath.DefaultModuleRegistry.getModule(DefaultModuleRegistry.java:118)
    at org.gradle.api.internal.classpath.DefaultModuleRegistry.getModules(DefaultModuleRegistry.java:192)
    at org.gradle.api.internal.classpath.DefaultModuleRegistry.access$100(DefaultModuleRegistry.java:49)
    at org.gradle.api.internal.classpath.DefaultModuleRegistry$DefaultModule.getRequiredModules(DefaultModuleRegistry.java:354)
    at org.gradle.api.internal.classpath.DefaultModuleRegistry$DefaultModule.collectRequiredModules(DefaultModuleRegistry.java:392)
    at org.gradle.api.internal.classpath.DefaultModuleRegistry$DefaultModule.getAllRequiredModules(DefaultModuleRegistry.java:375)
    at org.gradle.api.internal.DynamicModulesClassPathProvider.allRequiredModulesOfOptional(DynamicModulesClassPathProvider.java:104)
    at org.gradle.api.internal.DynamicModulesClassPathProvider.gradleExtensionsWithout(DynamicModulesClassPathProvider.java:69)
    at org.gradle.api.internal.DynamicModulesClassPathProvider.findClassPath(DynamicModulesClassPathProvider.java:51)
    at org.gradle.api.internal.DefaultClassPathRegistry.getClassPath(DefaultClassPathRegistry.java:35)
    at org.gradle.initialization.DefaultClassLoaderRegistry.(DefaultClassLoaderRegistry.java:35)
    at org.gradle.internal.service.scopes.GlobalScopeServices.createClassLoaderRegistry(GlobalScopeServices.java:314)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104)
    at org.gradle.internal.service.ReflectionBasedServiceMethod.invoke(ReflectionBasedServiceMethod.java:34)
    at org.gradle.internal.service.DefaultServiceRegistry$FactoryMethodService.invokeMethod(DefaultServiceRegistry.java:896)
    … 16 more
    Caused by: java.util.zip.ZipException: zip END header not found
    at java.base/java.util.zip.ZipFile$Source.zerror(ZipFile.java:1607)
    at java.base/java.util.zip.ZipFile$Source.findEND(ZipFile.java:1497)
    at java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1504)
    at java.base/java.util.zip.ZipFile$Source.(ZipFile.java:1308)
    at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1271)
    at java.base/java.util.zip.ZipFile$CleanableResource.(ZipFile.java:733)
    at java.base/java.util.zip.ZipFile$CleanableResource.get(ZipFile.java:850)
    at java.base/java.util.zip.ZipFile.(ZipFile.java:248)
    at java.base/java.util.zip.ZipFile.(ZipFile.java:177)
    at java.base/java.util.zip.ZipFile.(ZipFile.java:191)
    at org.gradle.api.internal.classpath.DefaultModuleRegistry.loadModuleProperties(DefaultModuleRegistry.java:258)
    … 37 more

  • Get more help at https://help.gradle.org

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

  • Get more help at https://help.gradle.org
    The terminal process “cmd.exe /d /c gradlew build -Dorg.gradle.java.home=“C:\Users\Public\wpilib\2022\jdk”” terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

Based on these parts of the trace, It looks like there’s some kind of filesystem corruption going on.

Caused by: org.gradle.api.UncheckedIOException: Could not load properties for module ‘gradle-java-compiler-plugin’ from C:\Users\LDSS Roboctics.gradle\permwrapper\dists\gradle-7.3.3-bin\6a41zxkdtcxs8rphpq6y0069z\gradle-7.3.3\lib\plugins\gradle-java-compiler-plugin-7.3.3.jar
Caused by: java.util.zip.ZipException: zip END header not found

Maybe try deleting C:\Users\LDSS Robotics\.gradle?

1 Like

Thank you! VS downloaded a fresh copy of it when I restarted and it works now.

1 Like

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