Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

NoSuchMethodError: org.apache.commons.io.FileUtils.getFile(Ljava/io/File;[Ljava/lang/String;)Ljava/io/File; #37

Closed
jamespullar opened this issue Apr 16, 2015 · 8 comments

Comments

@jamespullar
Copy link

When trying to run forkDebug from com.shazam.fork:fork-gradle-plugin:1.0.0-RC1-SNAPSHOT, I get the following NoSuchMethodError: org.apache.commons.io.FileUtils.getFile not found.

:express:forkDebug FAILED
:express:forkDebug (Thread[main,5,main]) completed. Took 0.048 secs.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':express:forkDebug'.
> org.apache.commons.io.FileUtils.getFile(Ljava/io/File;[Ljava/lang/String;)Ljava/io/File;

* Try:
Run with --debug option to get more log output.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':express:forkDebug'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
    at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:305)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:23)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:88)
    at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)
    at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
    at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:68)
    at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:55)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:149)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:106)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:86)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:80)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:36)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
    at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:51)
    at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210)
    at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
    at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
    at org.gradle.launcher.Main.doAction(Main.java:33)
    at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
    at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
    at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:33)
    at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:130)
    at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
Caused by: java.lang.NoSuchMethodError: org.apache.commons.io.FileUtils.getFile(Ljava/io/File;[Ljava/lang/String;)Ljava/io/File;
    at com.shazam.fork.system.adb.SpoonUtils.initAdb(SpoonUtils.java:35)
    at com.shazam.fork.injector.system.AndroidDebugBridgeInjector.<clinit>(AndroidDebugBridgeInjector.java:21)
    at com.shazam.fork.injector.pooling.DeviceLoaderInjector.deviceLoader(DeviceLoaderInjector.java:24)
    at com.shazam.fork.injector.pooling.PoolLoaderInjector.poolLoader(PoolLoaderInjector.java:21)
    at com.shazam.fork.injector.ForkRunnerInjector.forkRunner(ForkRunnerInjector.java:39)
    at com.shazam.fork.Fork.<init>(Fork.java:41)
    at com.shazam.fork.ForkBuilder.build(ForkBuilder.java:153)
    at com.shazam.fork.ForkBuilder$build$6.call(Unknown Source)
    at com.shazam.fork.gradle.ForkRunTask.runFork(ForkRunTask.groovy:70)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:218)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:211)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:200)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:579)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:562)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
    ... 47 more
@iordanis
Copy link
Member

iordanis commented May 4, 2015

We haven't been able to reproduce, so any more details would help.

@iordanis
Copy link
Member

Not able to reproduce, would need more info.

@hannesstruss
Copy link

I'm hitting the same error in the latest 1.2.0-SNAPSHOT (and on 1.1.1).

Some info:

------------------------------------------------------------
Gradle 2.4
------------------------------------------------------------

Build time:   2015-05-05 08:09:24 UTC
Build number: none
Revision:     5c9c3bc20ca1c281ac7972643f1e2d190f2c943c

Groovy:       2.3.10
Ant:          Apache Ant(TM) version 1.9.4 compiled on April 29 2014
JVM:          1.8.0_45 (Oracle Corporation 25.45-b02)
OS:           Mac OS X 10.10.5 x86_64

The only other Gradle plugin I'm using is android-apt.

Adding commons-io to the buildScript dependencies didn't help.

I'd be happy to provide more information, is there something specific that would help @iordanis ?

@iordanis
Copy link
Member

That's a bit hard to guess, would you be able to post a tiny project that reproduces the issue?

Fork already brings commons-io as a dependency, so I can't think of why it would not find that method. You can check: ./gradlew fork-runner:dependencies --configuration=compile. That brings commons-io version 2.4 that has that method.

@iordanis iordanis reopened this Oct 27, 2015
@hannesstruss
Copy link

Starting with a blank project, I encountered a different problem ("No devices found"), although adb devices lists my Genymotion instances as well as the plugged in physical device. I used ./gradlew fork -Dfork.eachdevice=true. Will report back once I got that running.

I also stumbled upon this, looks related, albeit from a while ago: https://issues.gradle.org/browse/GRADLE-2963

@iordanis
Copy link
Member

For that one stop the gradle daemon: ./gradlew --stop. We're tried putting a fix but it doesn't look like it worked. See #62

@hannesstruss
Copy link

I found the issue to be a different Gradle plugin that I overlooked (applied in top level build.gradle...), which depends on IOUtils using the old org.apache.commons group ID. That resolves the issue for me. Sorry for the fuzz!

@iordanis
Copy link
Member

Oh cool, good to know we haven't broken anything :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants