Could not create task of type 'Test'


(pistolala) #1

I’m having this error while building a project: Cause: Could not create task of type ‘Test’. what am i missing here? i’m using the latest release


(Peter Niederwieser) #2

Please provide the build script and full stack trace (-s).


(pistolala) #3

Exception is: org.gradle.api.GradleScriptException: A problem occurred evaluating root project ‘hello’.

at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:54)

at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:127)

at org.gradle.configuration.BuildScriptProcessor.evaluate(BuildScriptProcessor.java:38)

at org.gradle.configuration.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:43)

at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:474)

at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:73)

at org.gradle.configuration.ProjectEvaluationConfigurer.execute(ProjectEvaluationConfigurer.java:23)

at org.gradle.configuration.ProjectEvaluationConfigurer.execute(ProjectEvaluationConfigurer.java:21)

at org.gradle.configuration.DefaultBuildConfigurer$1.execute(DefaultBuildConfigurer.java:38)

at org.gradle.configuration.DefaultBuildConfigurer$1.execute(DefaultBuildConfigurer.java:35)

at org.gradle.api.internal.project.AbstractProject.configure(AbstractProject.java:450)

at org.gradle.api.internal.project.AbstractProject.allprojects(AbstractProject.java:445)

at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:35)

at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:141)

at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:112)

at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:80)

at org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:42)

at org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:28)

at org.gradle.launcher.exec.ExceptionReportingAction.execute(ExceptionReportingAction.java:32)

at org.gradle.launcher.exec.ExceptionReportingAction.execute(ExceptionReportingAction.java:21)

at org.gradle.launcher.cli.CommandLineActionFactory$WithLoggingAction.execute(CommandLineActionFactory.java:233)

at org.gradle.launcher.cli.CommandLineActionFactory$WithLoggingAction.execute(CommandLineActionFactory.java:217)

at org.gradle.launcher.Main.doAction(Main.java:48)

at org.gradle.launcher.exec.EntryPoint$1.execute(EntryPoint.java:53)

at org.gradle.launcher.exec.EntryPoint$1.execute(EntryPoint.java:51)

at org.gradle.launcher.exec.Execution.execute(Execution.java:28)

at org.gradle.launcher.exec.EntryPoint.run(EntryPoint.java:39)

at org.gradle.launcher.Main.main(Main.java:39)

at org.gradle.launcher.ProcessBootstrap.runNoExit(ProcessBootstrap.java:51)

at org.gradle.launcher.ProcessBootstrap.run(ProcessBootstrap.java:33)

at org.gradle.launcher.GradleMain.main(GradleMain.java:24) Caused by: org.gradle.api.tasks.TaskInstantiationException: Could not create task of type ‘Test’.

at org.gradle.api.internal.project.taskfactory.TaskFactory$1.call(TaskFactory.java:112)

at org.gradle.api.internal.project.taskfactory.TaskFactory$1.call(TaskFactory.java:107)

at org.gradle.api.internal.AbstractTask.injectIntoNewInstance(AbstractTask.java:125)

at org.gradle.api.internal.project.taskfactory.TaskFactory.createTaskObject(TaskFactory.java:107)

at org.gradle.api.internal.project.taskfactory.TaskFactory.createTask(TaskFactory.java:55)

at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory.createTask(AnnotationProcessingTaskFactory.java:64)

at org.gradle.api.internal.project.taskfactory.DependencyAutoWireTaskFactory.createTask(DependencyAutoWireTaskFactory.java:39)

at org.gradle.api.internal.tasks.DefaultTaskContainer.add(DefaultTaskContainer.java:49)

at org.gradle.api.internal.tasks.DefaultTaskContainer.add(DefaultTaskContainer.java:72)

at org.gradle.api.plugins.JavaPlugin.configureTest(JavaPlugin.java:145)

at org.gradle.api.plugins.JavaPlugin.apply(JavaPlugin.java:73)

at org.gradle.api.plugins.JavaPlugin.apply(JavaPlugin.java:47)

at org.gradle.api.internal.plugins.DefaultProjectsPluginContainer.providePlugin(DefaultProjectsPluginContainer.java:107)

at org.gradle.api.internal.plugins.DefaultProjectsPluginContainer.addPluginInternal(DefaultProjectsPluginContainer.java:71)

at org.gradle.api.internal.plugins.DefaultProjectsPluginContainer.apply(DefaultProjectsPluginContainer.java:37)

at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyPlugin(DefaultObjectConfigurationAction.java:101)

at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$200(DefaultObjectConfigurationAction.java:32)

at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$3.run(DefaultObjectConfigurationAction.java:72)

at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:114)

at org.gradle.api.internal.project.AbstractProject.apply(AbstractProject.java:841)

at org.gradle.api.Project$apply.call(Unknown Source)

at org.gradle.api.internal.project.ProjectScript.apply(ProjectScript.groovy:35)

at org.gradle.api.Script$apply.callCurrent(Unknown Source)

at build_188om727jd3rsd1obj4mhsmsav.run(/hello/build.gradle:1)

at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:52)

… 30 more Caused by: org.gradle.util.UncheckedException: java.net.UnknownHostException: Bit: Bit

at org.gradle.util.UncheckedException.asUncheckedException(UncheckedException.java:31)

at org.gradle.messaging.remote.internal.MessagingServices.determineNodeName(MessagingServices.java:96)

at org.gradle.messaging.remote.internal.MessagingServices.(MessagingServices.java:81)

at org.gradle.messaging.remote.internal.MessagingServices.(MessagingServices.java:73)

at org.gradle.messaging.remote.internal.MessagingServices.(MessagingServices.java:69)

at org.gradle.api.internal.project.GlobalServicesRegistry.createMessagingServices(GlobalServicesRegistry.java:85)

at org.gradle.api.internal.project.DefaultServiceRegistry.invoke(DefaultServiceRegistry.java:167)

at org.gradle.api.internal.project.DefaultServiceRegistry.access$100(DefaultServiceRegistry.java:51)

at org.gradle.api.internal.project.DefaultServiceRegistry$FactoryMethodService.create(DefaultServiceRegistry.java:286)

at org.gradle.api.internal.project.DefaultServiceRegistry$ManagedObjectProvider.getInstance(DefaultServiceRegistry.java:186)

at org.gradle.api.internal.project.DefaultServiceRegistry$SingletonService.getService(DefaultServiceRegistry.java:232)

at org.gradle.api.internal.project.DefaultServiceRegistry.get(DefaultServiceRegistry.java:133)

at org.gradle.api.internal.project.GlobalServicesRegistry.createMessagingServer(GlobalServicesRegistry.java:89)

at org.gradle.api.internal.project.DefaultServiceRegistry.invoke(DefaultServiceRegistry.java:167)

at org.gradle.api.internal.project.DefaultServiceRegistry.access$100(DefaultServiceRegistry.java:51)

at org.gradle.api.internal.project.DefaultServiceRegistry$FactoryMethodService.create(DefaultServiceRegistry.java:286)

at org.gradle.api.internal.project.DefaultServiceRegistry$ManagedObjectProvider.getInstance(DefaultServiceRegistry.java:186)

at org.gradle.api.internal.project.DefaultServiceRegistry$SingletonService.getService(DefaultServiceRegistry.java:232)

at org.gradle.api.internal.project.DefaultServiceRegistry.get(DefaultServiceRegistry.java:133)

at org.gradle.api.internal.project.DefaultServiceRegistry$ParentServices.getService(DefaultServiceRegistry.java:391)

at org.gradle.api.internal.project.DefaultServiceRegistry.get(DefaultServiceRegistry.java:133)

at org.gradle.api.internal.project.TopLevelBuildServiceRegistry.createWorkerProcessFactory(TopLevelBuildServiceRegistry.java:207)

at org.gradle.api.internal.project.DefaultServiceRegistry.invoke(DefaultServiceRegistry.java:167)

at org.gradle.api.internal.project.DefaultServiceRegistry.access$100(DefaultServiceRegistry.java:51)

at org.gradle.api.internal.project.DefaultServiceRegistry$FactoryMethodService.create(DefaultServiceRegistry.java:286)

at org.gradle.api.internal.project.DefaultServiceRegistry$ManagedObjectProvider.getInstance(DefaultServiceRegistry.java:186)

at org.gradle.api.internal.project.DefaultServiceRegistry$SingletonService.getService(DefaultServiceRegistry.java:232)

at org.gradle.api.internal.project.DefaultServiceRegistry$SingletonService.getFactory(DefaultServiceRegistry.java:252)

at org.gradle.api.internal.project.DefaultServiceRegistry$SingletonService.getFactory(DefaultServiceRegistry.java:240)

at org.gradle.api.internal.project.DefaultServiceRegistry.getFactory(DefaultServiceRegistry.java:150)

at org.gradle.api.internal.project.DefaultServiceRegistry$ParentServices.getFactory(DefaultServiceRegistry.java:378)

at org.gradle.api.internal.project.DefaultServiceRegistry.getFactory(DefaultServiceRegistry.java:150)

at org.gradle.api.internal.project.DefaultServiceRegistry$NestedServices.getFactory(DefaultServiceRegistry.java:349)

at org.gradle.api.internal.project.DefaultServiceRegistry.getFactory(DefaultServiceRegistry.java:150)

at org.gradle.api.internal.project.DefaultServiceRegistry$ParentServices.getFactory(DefaultServiceRegistry.java:378)

at org.gradle.api.internal.project.DefaultServiceRegistry.getFactory(DefaultServiceRegistry.java:150)

at org.gradle.api.internal.project.DefaultServiceRegistry$ParentServices.getFactory(DefaultServiceRegistry.java:378)

at org.gradle.api.internal.project.DefaultServiceRegistry.getFactory(DefaultServiceRegistry.java:150)

at org.gradle.api.tasks.testing.Test.(Test.java:114)

at org.gradle.api.tasks.testing.Test_Decorated.(Unknown Source)

at org.gradle.api.internal.project.taskfactory.TaskFactory$1.call(TaskFactory.java:110)

… 54 more Caused by: java.net.UnknownHostException: Bit: Bit

at org.gradle.messaging.remote.internal.MessagingServices.determineNodeName(MessagingServices.java:94)

… 93 more

Build script is only: apply plugin: ‘java’

im thinking this might be a folder permission thing. i’ve tried building this in windows and it worked. this error only appears in linux


(Peter Niederwieser) #4

This means that java.net.InetAdress.getLocalHost() doesn’t work on your Linux machine. It’s unable to determine the IP address for localhost. Do you have an explanation for this?


(pistolala) #5

Fixed! it’s looking for Bit host. i’ve edit my /etc/hosts file and added Bit thanks!


(Stevo Slavić) #6

Just bumped on to same issue while building spring framework. Adding computer name to /etc/hosts solved it.


(Emil Sit) #7

I have seen this more frequently recently (using slaves in Jenkins spawned dynamically on EC2). Was there some sort of recent change that might have made this more likely to occur?

We are using 1.0m7 but will upgrade to 1.0m8.


(Adam Murdoch) #8

It is fixed in 1.0m8.