错误:链接文件资源失败。有没有人解决?

时间:2018-09-28 07:27:38

标签: java android

在构建过程中,链接文件资源失败。有没有人解决?

  

org.gradle.api.tasks.TaskExecutionException:任务':app:processDebugResources'的执行失败。       在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)       在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)       在org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)处       在org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)       在org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)       在org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60)       在org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)       在org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87)       在org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)处       在org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)       在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.run(DefaultTaskGraphExecuter.java:248)       在org.gradle.internal.progress.DefaultBuildOperationExecutor $ RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)处       在org.gradle.internal.progress.DefaultBuildOperationExecutor $ RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)       在org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)       在org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)       在org.gradle.execution.taskgraph.DefaultTaskGraphExecuter $ EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)处       在org.gradle.execution.taskgraph.DefaultTaskGraphExecuter $ EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)处       在org.gradle.execution.taskgraph.DefaultTaskPlanExecutor $ TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)处       在org.gradle.execution.taskgraph.DefaultTaskPlanExecutor $ TaskExecutorWorker.access $ 200(DefaultTaskPlanExecutor.java:79)       在org.gradle.execution.taskgraph.DefaultTaskPlanExecutor $ TaskExecutorWorker $ 1.execute(DefaultTaskPlanExecutor.java:104)       在org.gradle.execution.taskgraph.DefaultTaskPlanExecutor $ TaskExecutorWorker $ 1.execute(DefaultTaskPlanExecutor.java:98)       在org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:626)处       在org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:581)处       在org.gradle.execution.taskgraph.DefaultTaskPlanExecutor $ TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)       在org.gradle.internal.concurrent.ExecutorPolicy $ CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)       在org.gradle.internal.concurrent.ManagedExecutorImpl $ 1.run(ManagedExecutorImpl.java:46)       在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)       在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617)       在org.gradle.internal.concurrent.ThreadFactoryImpl $ ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)       在java.lang.Thread.run(Thread.java:745)   引起原因:org.gradle.tooling.BuildException:无法处理资源,有关详细信息,请参见上面的aapt输出。       在com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask.invokeAaptForSplit(LinkApplicationAndroidResourcesTask.java:512)       在com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask.doFullTask​​Action(LinkApplicationAndroidResourcesTask.java:249)       在com.android.build.gradle.internal.tasks.IncrementalTask​​.taskAction(IncrementalTask​​.java:106)       在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)处       在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)       在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)       在java.lang.reflect.Method.invoke(Method.java:498)       在org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)       在org.gradle.api.internal.project.taskfactory.IncrementalTask​​Action.doExecute(IncrementalTask​​Action.java:46)       在org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)       在org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)       在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter $ 1.run(ExecuteActionsTaskExecuter.java:121)       在org.gradle.internal.progress.DefaultBuildOperationExecutor $ RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)处       在org.gradle.internal.progress.DefaultBuildOperationExecutor $ RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)       在org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)       在org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)       在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:110)处       在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)       ...另外32个       禁止:java.lang.RuntimeException:一些文件处理失败,有关详细信息,请参见日志           在com.android.builder.internal.aapt.QueuedResourceProcessor.waitForAll(QueuedResourceProcessor.java:121)           在com.android.builder.internal.aapt.QueuedResourceProcessor.end(QueuedResourceProcessor.java:141)           在com.android.builder.internal.aapt.v2.QueueableAapt2.close(QueueableAapt2.java:104)           在com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask.doFullTask​​Action(LinkApplicationAndroidResourcesTask.java:293)           ...另外48个   引起原因:com.android.ide.common.process.ProcessException:无法执行aapt       在com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:809)       在com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:797)       在com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask.invokeAaptForSplit(LinkApplicationAndroidResourcesTask.java:491)       ...还有49个   引起原因:java.util.concurrent.ExecutionException:java.util.concurrent.ExecutionException:com.android.builder.internal.aapt.v2.Aapt2Exception:AAPT2错误:请检查日志以获取详细信息       在com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:503)       在com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:482)       在com.google.common.util.concurrent.AbstractFuture $ TrustedFuture.get(AbstractFuture.java:79)       在com.android.builder.internal.aapt.AbstractAapt.link(AbstractAapt.java:34)       在com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:807)       ...另外51个   引起原因:java.util.concurrent.ExecutionException:com.android.builder.internal.aapt.v2.Aapt2Exception:AAPT2错误:检查日志以获取详细信息       在com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:503)       在com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:462)       在com.google.common.util.concurrent.AbstractFuture $ TrustedFuture.get(AbstractFuture.java:79)       在com.android.builder.internal.aapt.v2.QueueableAapt2.lambda $ makeValidatedPackage $ 1(QueueableAapt2.java:166)       在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)       在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617)       ...还有1个   引起原因:com.android.builder.internal.aapt.v2.Aapt2Exception:AAPT2错误:检查日志以获取详细信息       在com.android.builder.png.AaptProcess $ NotifierProcessOutput.handleOutput(AaptProcess.java:443)       在com.android.builder.png.AaptProcess $ NotifierProcessOutput.err(AaptProcess.java:395)       在com.android.builder.png.AaptProcess $ ProcessOutputFacade.err(AaptProcess.java:312)       在com.android.utils.GrabProcessOutput $ 1.run(GrabProcessOutput.java:104)

2 个答案:

答案 0 :(得分:0)

  

清洁项目

     

重建项目

     

使用gradle文件同步项目

答案 1 :(得分:0)

这是xml文件中的硬编码颜色资源问题。我为颜色写了五个十六进制值,而不是6,而android studio对于未指出发生此错误的行很奇怪。从此堆栈溢出链接中找到了帮助–

AAPT2 error: check logs for details