java.lang.NoSuchMethodError: com.android.build.api.transform.SecondaryFile.nonIncremental with gradle-2.14.1


(Xuehui Chen) #1

My android app compiled well with gradle-2.10, but met a java.lang.NoSuchMethodError while upgrading to gradle-2.14.1.
Below is the Error stacktrace:
18:39:05.055 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
18:39:05.056 [ERROR] [org.gradle.BuildExceptionReporter]
18:39:05.059 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
18:39:05.059 [ERROR] [org.gradle.BuildExceptionReporter] com.android.build.api.transform.SecondaryFile.nonIncremental(Ljava/io/File;)Lcom/android/build/api/transform/SecondaryFile;
18:39:05.059 [ERROR] [org.gradle.BuildExceptionReporter]
18:39:05.059 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
18:39:05.060 [ERROR] [org.gradle.BuildExceptionReporter] java.lang.NoSuchMethodError: com.android.build.api.transform.SecondaryFile.nonIncremental(Ljava/io/File;)Lcom/android/build/api/transform/SecondaryFile;
18:39:05.060 [ERROR] [org.gradle.BuildExceptionReporter] at com.android.build.gradle.internal.transforms.DexTransform.getSecondaryFiles(DexTransform.java:165)
18:39:05.060 [ERROR] [org.gradle.BuildExceptionReporter] at com.android.build.gradle.internal.pipeline.TransformTask.getOtherFileInputs(TransformTask.java:79)
18:39:05.060 [ERROR] [org.gradle.BuildExceptionReporter] at com.android.build.gradle.internal.pipeline.TransformTask_Decorated.getOtherFileInputs(Unknown Source)
18:39:05.060 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
18:39:05.060 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$PropertyInfo$4.create(AnnotationProcessingTaskFactory.java:457)
18:39:05.060 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.util.SingleMessageLogger.whileDisabled(SingleMessageLogger.java:171)
18:39:05.060 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$PropertyInfo.getValue(AnnotationProcessingTaskFactory.java:455)
18:39:05.060 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$Validator$1.call(AnnotationProcessingTaskFactory.java:264)
18:39:05.060 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.util.GUtil.uncheckedCall(GUtil.java:401)
18:39:05.060 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.file.collections.BuildDependenciesOnlyFileCollectionResolveContext.add(BuildDependenciesOnlyFileCollectionResolveContext.java:72)
18:39:05.061 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.file.collections.BuildDependenciesOnlyFileCollectionResolveContext.add(BuildDependenciesOnlyFileCollectionResolveContext.java:79)
18:39:05.061 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection.visitContents(DefaultConfigurableFileCollection.java:91)
18:39:05.061 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.file.CompositeFileCollection.visitDependencies(CompositeFileCollection.java:156)
18:39:05.061 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection.visitDependencies(DefaultConfigurableFileCollection.java:97)
18:39:05.061 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext$TaskGraphImpl.getNodeValues(CachingTaskDependencyResolveContext.java:88)
18:39:05.061 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.graph.CachingDirectedGraphWalker$GraphWithEmpyEdges.getNodeValues(CachingDirectedGraphWalker.java:202)
18:39:05.061 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.graph.CachingDirectedGraphWalker.doSearch(CachingDirectedGraphWalker.java:112)
18:39:05.061 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.graph.CachingDirectedGraphWalker.findValues(CachingDirectedGraphWalker.java:64)
18:39:05.061 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.doResolve(CachingTaskDependencyResolveContext.java:76)
18:39:05.061 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.resolve(CachingTaskDependencyResolveContext.java:65)
18:39:05.061 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.getDependencies(CachingTaskDependencyResolveContext.java:55)
18:39:05.061 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.addToTaskGraph(DefaultTaskExecutionPlan.java:139)
18:39:05.061 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.addTasks(DefaultTaskGraphExecuter.java:98)
18:39:05.061 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.TaskNameResolvingBuildConfigurationAction.configure(TaskNameResolvingBuildConfigurationAction.java:47)
18:39:05.061 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildConfigurationActionExecuter.configure(DefaultBuildConfigurationActionExecuter.java:48)
18:39:05.061 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildConfigurationActionExecuter.access$000(DefaultBuildConfigurationActionExecuter.java:25)
18:39:05.061 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildConfigurationActionExecuter$1.proceed(DefaultBuildConfigurationActionExecuter.java:54)
18:39:05.061 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultTasksBuildExecutionAction.configure(DefaultTasksBuildExecutionAction.java:44)
18:39:05.061 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildConfigurationActionExecuter.configure(DefaultBuildConfigurationActionExecuter.java:48)
18:39:05.061 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildConfigurationActionExecuter.access$000(DefaultBuildConfigurationActionExecuter.java:25)
18:39:05.061 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildConfigurationActionExecuter$1.proceed(DefaultBuildConfigurationActionExecuter.java:54)
18:39:05.061 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.ExcludedTaskFilteringBuildConfigurationAction.configure(ExcludedTaskFilteringBuildConfigurationAction.java:47)
18:39:05.061 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildConfigurationActionExecuter.configure(DefaultBuildConfigurationActionExecuter.java:48)
18:39:05.061 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildConfigurationActionExecuter.select(DefaultBuildConfigurationActionExecuter.java:36)
18:39:05.061 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher$3.run(DefaultGradleLauncher.java:142)
18:39:05.062 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.Factories$1.create(Factories.java:22)
18:39:05.062 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
18:39:05.062 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:53)
18:39:05.062 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:139)
18:39:05.062 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
18:39:05.062 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:98)
18:39:05.062 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:92)
18:39:05.062 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
18:39:05.062 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:63)
18:39:05.062 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:92)
18:39:05.062 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:83)
18:39:05.062 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:99)
18:39:05.062 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
18:39:05.062 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
18:39:05.062 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:48)
18:39:05.062 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
18:39:05.062 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:81)
18:39:05.062 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:46)
18:39:05.062 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:52)
18:39:05.062 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
18:39:05.062 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
18:39:05.062 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
18:39:05.062 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
18:39:05.062 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
18:39:05.062 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
18:39:05.062 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
18:39:05.062 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
18:39:05.062 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
18:39:05.063 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
18:39:05.063 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.util.Swapper.swap(Swapper.java:38)
18:39:05.063 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
18:39:05.063 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
18:39:05.063 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.health.DaemonHealthTracker.execute(DaemonHealthTracker.java:40)
18:39:05.063 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
18:39:05.063 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
18:39:05.063 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
18:39:05.063 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
18:39:05.063 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
18:39:05.063 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
18:39:05.063 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
18:39:05.063 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.health.HintGCAfterBuild.execute(HintGCAfterBuild.java:41)
18:39:05.063 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
18:39:05.063 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
18:39:05.063 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:237)
18:39:05.063 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
18:39:05.063 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
18:39:05.063 [ERROR] [org.gradle.BuildExceptionReporter]
18:39:05.063 [LIFECYCLE] [org.gradle.BuildResultLogger]
18:39:05.063 [LIFECYCLE] [org.gradle.BuildResultLogger] BUILD FAILED
18:39:05.063 [LIFECYCLE] [org.gradle.BuildResultLogger]
18:39:05.063 [LIFECYCLE] [org.gradle.BuildResultLogger] Total time: 10.453 secs