导入gradle项目时出错

时间:2014-09-03 10:46:04

标签: eclipse

当我尝试导入gradle项目,并点击" build model"时,我收到此错误"无法找到参数的方法add()[cleanGhPages,class org.gradle.api任务集上的.tasks.Delete。"

java.lang.reflect.InvocationTargetException     在org.springsource.ide.eclipse.gradle.core.util.GradleRunnable.run(GradleRunnable.java:92)     at org.eclipse.jface.operation.ModalContext $ ModalContextThread.run(ModalContext.java:121) 引起:org.eclipse.core.runtime.CoreException:无法在任务集上找到参数[cleanGhPages,class org.gradle.api.tasks.Delete]的方法add()。     at org.springsource.ide.eclipse.gradle.core.GradleModelProvider $ GroupedModelProvider.ensureModels(GradleModelProvider.java:284)     at org.springsource.ide.eclipse.gradle.core.GradleProject.getGradleModel(GradleProject.java:633)     at org.springsource.ide.eclipse.gradle.core.GradleProject.getSkeletalGradleModel(GradleProject.java:654)     at org.springsource.ide.eclipse.gradle.ui.wizards.GradleImportWizardPageOne $ 11.doit(GradleImportWizardPageOne.java:516)     at org.springsource.ide.eclipse.gradle.core.util.GradleRunnable.run(GradleRunnable.java:84)     ......还有1个 引起:org.gradle.tooling.BuildException:无法获取类型的模型' HierarchicalEclipseProject'使用Gradle安装' D:\ Fota docs \ software \ gradle-2.1-rc-4'。     在org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:53)     在org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor $ 1 $ 1.run(DefaultAsyncConsumerActionExecutor.java:57)     at org.gradle.internal.concurrent.DefaultExecutorFactory $ StoppableExecutorImpl $ 1.run(DefaultExecutorFactory.java:64)     at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)     at java.util.concurrent.ThreadPoolExecutor $ Worker.run(Unknown Source)     在java.lang.Thread.run(未知来源)     在org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(BlockingResultHandler.java:46)     在org.gradle.tooling.internal.consumer.DefaultModelBuilder.get(DefaultModelBuilder.java:48)     at org.springsource.ide.eclipse.gradle.core.GradleModelProvider.buildModel(GradleModelProvider.java:385)     at org.springsource.ide.eclipse.gradle.core.GradleModelProvider $ GroupedModelProvider.ensureModels(GradleModelProvider.java:290)     at org.springsource.ide.eclipse.gradle.core.GradleProject.getModelProvider(GradleProject.java:569)     at org.springsource.ide.eclipse.gradle.core.GradleProject.getGradleModel(GradleProject.java:629)     ......还有4个 由以下原因引起:org.gradle.internal.exceptions.LocationAwareException:Script' D:\ SimianArmy-master \ gradle \ _cublic.gradle'行:61 评估脚本时出现问题。     at org.gradle.initialization.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:77)     at org.gradle.initialization.MultipleBuildFailuresExceptionAnalyser.transform(MultipleBuildFailuresExceptionAnalyser.java:47)     at org.gradle.initialization.StackTraceSanitizingExceptionAnalyser.transform(StackTraceSanitizingExceptionAnalyser.java:30)     在org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:108)     在org.gradle.initialization.DefaultGradleLauncher.getBuildAnalysis(DefaultGradleLauncher.java:97)     at org.gradle.launcher.exec.InProcessBuildActionExecuter $ DefaultBuildController.configure(InProcessBuildActionExecuter.java:84)     在org.gradle.tooling.internal.provider.BuildModelAction.run(BuildModelAction.java:53)     在org.gradle.tooling.internal.provider.BuildModelAction.run(BuildModelAction.java:32)     在org.gradle.tooling.internal.provider.ConfiguringBuildAction.run(ConfiguringBuildAction.java:134)     在org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:36)     at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)     在org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:47)     在org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)     在org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)     在org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:35)     在org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)     在org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:24)     在org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)     在org.gradle.launcher.daemon.server.exec.StartStopIfBuildAndStop.execute(StartStopIfBuildAndStop.java:33)     在org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)     在org.gradle.launcher.daemon.server.exec.ReturnResult.execute(ReturnResult.java:34)     在org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)     在org.gradle.launcher.daemon.server.exec.ForwardClientInput $ 2.call(ForwardClientInput.java:71)     在org.gradle.launcher.daemon.server.exec.ForwardClientInput $ 2.call(ForwardClientInput.java:69)     在org.gradle.util.Swapper.swap(Swapper.java:38)     在org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:69)     在org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)     在org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)     在org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)     在org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)     在org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:70)     在org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)     在org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)     在org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy $ 1.run(StartBuildOrRespondWithBusy.java:45)     在org.gradle.launcher.daemon.server.DaemonStateCoordinator.runCommand(DaemonStateCoordinator.java:258)     在org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy.doBuild(StartBuildOrRespondWithBusy.java:49)     在org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)     在org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)     在org.gradle.launcher.daemon.server.exec.HandleCancel.execute(HandleCancel.java:36)     在org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)     在org.gradle.launcher.daemon.server.exec.HandleStop.execute(HandleStop.java:30)     在org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)     在org.gradle.launcher.daemon.server.exec.DaemonHygieneAction.execute(DaemonHygieneAction.java:39)     在org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)     在org.gradle.launcher.daemon.server.exec.CatchAndForwardDaemonFailure.execute(CatchAndForwardDaemonFailure.java:32)     在org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)     在org.gradle.launcher.daemon.server.exec.DefaultDaemonCommandExecuter.executeCommand(DefaultDaemonCommandExecuter.java:52)     在org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler $ ConnectionWorker.handleCommand(DefaultIncomingConnectionHandler.java:154)     at org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler $ ConnectionWorker.receiveAndHandleCommand(DefaultIncomingConnectionHandler.java:128)     at org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler $ ConnectionWorker.run(DefaultIncomingConnectionHandler.java:116)     at org.gradle.internal.concurrent.DefaultExecutorFactory $ StoppableExecutorImpl $ 1.run(DefaultExecutorFactory.java:64) 引起:org.gradle.api.GradleScriptException:评估脚本时出现问题。     在org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory $ ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:54)     at org.gradle.configuration.DefaultScriptPluginFactory $ ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:190)     at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyScript(DefaultObjectConfigurationAction.java:93)     at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access $ 000(DefaultObjectConfigurationAction.java:36)     at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction $ 1.run(DefaultObjectConfigurationAction.java:62)     在org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:131)     在org.gradle.api.internal.project.AbstractPluginAware.apply(AbstractPluginAware.java:37)     在org.gradle.api.Project $ apply $ 0.call(未知来源)     在org.gradle.api.internal.project.ProjectScript.apply(ProjectScript.groovy:34)     在org.gradle.api.Script $ apply $ 0.callCurrent(Unknown Source)     在build_bipg314dh48t238tum66f7ge9.run(D:\ SimianArmy-master \ build.gradle:21)     在org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory $ ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:52)     at org.gradle.configuration.DefaultScriptPluginFactory $ ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:190)     在org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:39)     在org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:26)     在org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:34)     在org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:55)     在org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:521)     在org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:82)     在org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:31)     在org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:129)     在org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:106)     ......还有47个 引起:org.gradle.api.internal.plugins.PluginApplicationException:无法应用插件[id' github-pages']     at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyPlugin(DefaultObjectConfigurationAction.java:117)     at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access $ 200(DefaultObjectConfigurationAction.java:36)     在org.gradle.api.internal.plugins.DefaultObjectConfigurationAction $ 3.run(DefaultObjectConfigurationAction.java:80)     在org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:131)     在org.gradle.groovy.scripts.DefaultScript.apply(DefaultScript.java:98)     在org.gradle.api.Script $ apply $ 0.callCurrent(Unknown Source)     at convention_2oclca8oqc3rr52l948m1sb62u.run(D:\ SimianArmy-master \ gradle \ _cublic.gradle:61)     在org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory $ ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:52)     ......还有68个 引起:org.gradle.api.internal.MissingMethodException:无法在任务集上找到参数[cleanGhPages,class org.gradle.api.tasks.Delete]的方法add()。     at org.gradle.api.internal.AbstractDynamicObject.methodMissingException(AbstractDynamicObject.java:68)     at org.gradle.api.internal.AbstractDynamicObject.invokeMethod(AbstractDynamicObject.java:56)     在org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:172)     at org.gradle.api.internal.tasks.DefaultTaskContainer_Decorated.invokeMethod(Unknown Source)     在org.ajoberstar.gradle.git.plugins.GithubPagesPlugin.configureTasks(GithubPagesPlugin.groovy:76)     在org.ajoberstar.gradle.git.plugins.GithubPagesPlugin.this $ 2 $ configureTasks(GithubPagesPlugin.groovy)     在org.ajoberstar.gradle.git.plugins.GithubPagesPlugin $ this $ 2 $ configureTasks $ 0.callCurrent(Unknown Source)     在org.ajoberstar.gradle.git.plugins.GithubPagesPlugin.apply(GithubPagesPlugin.groovy:57)     在org.ajoberstar.gradle.git.plugins.GithubPagesPlugin.apply(GithubPagesPlugin.groovy)     在org.gradle.api.internal.plugins.DefaultPluginContainer.providePlugin(DefaultPluginContainer.java:188)     在org.gradle.api.internal.plugins.DefaultPluginContainer.addPluginInternal(DefaultPluginContainer.java:137)     在org.gradle.api.internal.plugins.DefaultPluginContainer.apply(DefaultPluginContainer.java:103)     在org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyPlugin(DefaultObjectConfigurationAction.java:115)     ......还有75个

1 个答案:

答案 0 :(得分:0)

我将eclipse升级到4.4.1后遇到了这个问题。 以下解决方案适合我。试试吧。

“作为一种解决方法,人们可以将-D属性添加到他们的STS.ini,eclipse.ini或GGTS.ini,以将这些属性设置为他们在Eclipse 4.4.1中曾经拥有的值

-Dosgi.configuration.area.default=null
-Dosgi.user.area.default=null
-Dosgi.user.area=@user.dir

参考网址:

https://github.com/spring-projects/eclipse-integration-gradle/issues/48

Error at building model of new Gradle project for libgdx