错误:任务':app:processDebugResources'的执行失败。>(第3485行,第33行)解析错误。找到“-”,预期“(”
Posted
技术标签:
【中文标题】错误:任务\':app:processDebugResources\'的执行失败。>(第3485行,第33行)解析错误。找到“-”,预期“(”【英文标题】:Error:Execution failed for task ':app:processDebugResources'.> (line 3485,col 33) Parse error. Found "-", expected "("错误:任务':app:processDebugResources'的执行失败。>(第3485行,第33行)解析错误。找到“-”,预期“(” 【发布时间】:2018-11-11 13:16:43 【问题描述】:我的应用程序运行良好,但是当我重新启动 android Studio 时出现此错误: 错误:任务 ':app:processDebugResources' 执行失败。
(第 3485 行,第 33 列)解析错误。找到“-”,预期“(” 问题堆栈跟踪: com.github.javaparser.GeneratedJavaParser.generateParseException(GeneratedJavaParser.java:10037) com.github.javaparser.GeneratedJavaParser.jj_consume_token(GeneratedJavaParser.java:9893) com.github.javaparser.GeneratedJavaParser.Parameters(GeneratedJavaParser.java:1329) com.github.javaparser.GeneratedJavaParser.MethodDeclaration(GeneratedJavaParser.java:1253) com.github.javaparser.GeneratedJavaParser.ClassOrInterfaceBodyDeclaration(GeneratedJavaParser.java:1006) com.github.javaparser.GeneratedJavaParser.ClassOrInterfaceBody(GeneratedJavaParser.java:899) com.github.javaparser.GeneratedJavaParser.ClassOrInterfaceDeclaration(GeneratedJavaParser.java:463) com.github.javaparser.GeneratedJavaParser.ClassOrInterfaceBodyDeclaration(GeneratedJavaParser.java:967) com.github.javaparser.GeneratedJavaParser.ClassOrInterfaceBody(GeneratedJavaParser.java:899) com.github.javaparser.GeneratedJavaParser.ClassOrInterfaceDeclaration(GeneratedJavaParser.java:463) com.github.javaparser.GeneratedJavaParser.CompilationUnit(GeneratedJavaParser.java:209) com.github.javaparser.JavaParser.parse(JavaParser.java:123) com.github.javaparser.JavaParser.simplifiedParse(JavaParser.java:323) com.github.javaparser.JavaParser.parse(JavaParser.java:198) butterknife.plugin.FinalRClassBuilder.brewJava(FinalRClassBuilder.java:40) butterknife.plugin.ButterKnifePlugin$applyPlugin$1$1$1.execute(ButterKnifePlugin.kt:34) butterknife.plugin.ButterKnifePlugin$applyPlugin$1$1$1.execute(ButterKnifePlugin.kt:15) org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:632) org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:615) org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:95) org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:76) org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:55) org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62) org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58) org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88) org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:46) org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51) org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54) org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43) org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34) org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:236) org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:228) org.gradle.internal.Transformers$4.transform(Transformers.java:169) org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106) org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:61) org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:228) org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:215) org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:77) org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:58) org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:32) org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:113) org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37) org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37) org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23) org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43) org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32) org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37) org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30) org.gradle.initialization.DefaultGradleLauncher$3.execute(DefaultGradleLauncher.java:196) org.gradle.initialization.DefaultGradleLauncher$3.execute(DefaultGradleLauncher.java:193) org.gradle.internal.Transformers$4.transform(Transformers.java:169) org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106) org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:56) --> org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:193) org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:119) org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:102) org.gradle.launcher.exec.GradleBuildController.run(GradleBuildController.java:71) org.gradle.tooling.internal.provider.runner.BuildModelActionRunner.run(BuildModelActionRunner.java:50) org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35) org.gradle.tooling.internal.provider.runner.RunAsBuildOperationBuildActionRunner$1.execute(RunAsBuildOperationBuildActionRunner.java:43) org.gradle.tooling.internal.provider.runner.RunAsBuildOperationBuildActionRunner$1.execute(RunAsBuildOperationBuildActionRunner.java:40) org.gradle.internal.Transformers$4.transform(Transformers.java:169) org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106) org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:56) org.gradle.tooling.internal.provider.runner.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:40) org.gradle.tooling.internal.provider.runner.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:75) org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35) org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:41) org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26) org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75) org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:49) org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:44) org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:29) org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67) org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:47) org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26) org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34) org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74) org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72) org.gradle.util.Swapper.swap(Swapper.java:38) org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72) org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55) org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60) org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72) org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50) org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297) org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54) org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) java.lang.Thread.run(Thread.java:745)
【问题讨论】:
【参考方案1】:我在我的项目中遇到了同样的问题。我发现我在布局 xml 文件中使用了 -
而不是 _
作为 id。检查在您的项目中使用任何-
。例如替换:
android:id="@+id/button-one"
与:
android:id="@+id/button_one"
【讨论】:
tnx.u 救了我的命。以上是关于错误:任务':app:processDebugResources'的执行失败。>(第3485行,第33行)解析错误。找到“-”,预期“(”的主要内容,如果未能解决你的问题,请参考以下文章
Android错误:错误:任务':app:transformClassesWithDexForDebug'的执行失败
错误:任务 ':app:packageAllDebugClassesForMultiDex' 执行失败
错误:任务“:app:transformClassesWithDexForDebug”执行失败
错误:任务':app:kaptDebugKotlin'的执行失败
错误:任务“:app:transformClassesWithDexForRelease”执行失败。
Gradle构建错误,错误:任务':app:transformResourcesWithMergeJavaResForDebug'的执行失败