构建时出现以下错误,并且我正在寻找一些帮助来查明发生这种情况的原因。

以下是运行./gradlew assembleStagingDebug的输出

//... omitted for brevity
:app:processStagingDebugResources
:app:generateStagingDebugSources
:app:compileStagingDebugJava
:app:patchAndroidJar
:app:_compileStagingDebugJava
error: incompatible types: ButtonCallback is not a functional interface
error: incompatible types: ButtonCallback is not a functional interface
error: incompatible types: ButtonCallback is not a functional interface
error: incompatible types: ButtonCallback is not a functional interface
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
4 errors
:app:_compileStagingDebugJava FAILED

使用--stacktrace运行时,我得到以下信息:

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:_compileStagingDebugJava'.
    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: org.gradle.api.internal.tasks.compile.CompilationFailedException: Compilation failed with exit code 1; see the compiler error output for details.
    at org.gradle.api.internal.tasks.compile.CommandLineJavaCompiler.executeCompiler(CommandLineJavaCompiler.java:61)
    at org.gradle.api.internal.tasks.compile.CommandLineJavaCompiler.execute(CommandLineJavaCompiler.java:43)
    at org.gradle.api.internal.tasks.compile.CommandLineJavaCompiler.execute(CommandLineJavaCompiler.java:33)
    at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegateAndHandleErrors(NormalizingJavaCompiler.java:97)
    at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:50)
    at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:36)
    at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:34)
    at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:25)
    at org.gradle.api.tasks.compile.JavaCompile.performCompilation(JavaCompile.java:158)
    at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:138)
    at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:92)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(AnnotationProcessingTaskFactory.java:235)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:211)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(AnnotationProcessingTaskFactory.java:222)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:200)
    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

#1楼 票数:1

缩小问题范围。 似乎是 https://github.com/afollestad/material-dialogs的问题(以及与Java 8 / Retrolambda的兼容性?)

更新(1/14/15):这是使用Retrolambda并在https://github.com/afollestad/material-dialogs库中进行了某些更改的结果。 有一个实例,我使用的是闭包,无法再使用它(因为它不再是具有单个方法的类)。 Android Studio并没有直接指出错误。 相反,我得到了模糊的编译错误。

  ask by loeschg translate from so

未解决问题?本站智能推荐:

1回复

离子构建Android进程异常错误

,大家好,跑步后 我收到此错误: 我试图在互联网上找到一些解决方法,但没有任何效果,因此我愿意提出任何建议。 谢谢!
3回复

特拉维斯android构建错误

我收到以下错误: 我上传了gradlew,gradle-wrapper.properties,gradle-wrapper.jar 尝试在.travis.yml中编写gradlew和gradle-wrapper.jar 甚至在.travis.yml脚本中安装了grad
2回复

Android程序类型已存在错误

我经历了多个具有相同错误的线程以找到解决方案(它们在gradle文件中提到重复的程序包名称,在AndroidManifests中重复和依赖版本不匹配),但与我的情况都不相同。 这是构建应用程序时收到的错误消息: 我的应用程序gradle文件如下所示: 我添加(游戏)的新库的好处
1回复

尝试在Android中构建时出现Values-ldltr-v21.xml错误+ AAPT2错误

长话短说,我是android的一个完整的菜鸟,从codecanyon购买了一个应用程序代码以用于我的下一个项目,我认为它很容易使用,因为几周前我已经做了类似的事情。 无论如何,在尝试构建/测试运行应用程序时,我都会遇到以下错误: C:\\ Users \\用户名\\文件\\ MyApp的
1回复

Android Studio构建transformClassesWithJarMergingForDebug错误

我在一个我重新创建的新项目中遇到了Android Studio的构建问题。 请按照我的所作所为,如果有人知道如何继续,请告诉我! 我开始了一个新项目,选择“导航抽屉活动”作为我的初始起点(可能是我猜的任何东西)。 我立即构建了我的新“空”应用程序并在真实设备上调试它(nexus 9)。
2回复

useOldManifestMerger导致构建错误

我正在尝试使用适用于Android的Gradle插件0.10.0版中提供的此新功能。 但我不断收到此错误消息: 失败:构建失败,发生异常。 出了什么问题:任务':xxxxxx:processDebugManifest'的执行失败。 清单合并失败
1回复

Gradle构建错误

我刚开始使用Android Studio,并且尝试运行我的应用程序,直到出现Gradle构建错误: 请帮忙! 谢谢
3回复

为不同的口味和不同的构建类型生成不同的gradle常量-Android

要求非常简单。 但是我没有找到任何办法。 我有一个具有两种风格的应用程序:原始和黑色。 每种类型都有两种构建类型 :调试和发布 我正在为不同的构建类型生成运行时gradle常量“ APP_INFO”。 我现在对BuildConfig.APPINFO的了解 flav