Android Studio中“执行taskAction”是什么意思

时间:2019-01-19 20:04:36

标签: java android

在构建应用时在Android Studio中出错:

  

Build>运行Build>运行任务> app.mergeDebugResources>执行taskAction

     

org.gradle.api.tasks.TaskExecutionException:任务执行失败   ':app:mergeDebugResources'。在   org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:103)     在   org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:73)     在   org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)     在   org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)     在   org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)     在   org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)     在   org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)     在   org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)     在   org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)     在   org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)     在   org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)     在   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:256)     在   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:249)     在   org.gradle.execution.taskgraph.DefaultTaskGraphExecuter $ EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:238)     在   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:663)     在   org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:597)     在   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)造成原因:   com.android.build.gradle.tasks.ResourceException:   C:\ Users \ admin \ Documents \ Computer Science \ Software   工程\项目\移动应用程序\ app \ src \ main \ res \ drawable \ Logo.png:   错误:“ L”不是有效的基于文件的资源名称字符:   基于文件的资源名称只能包含小写的a-z,0-9或   下划线C:\ Users \ admin \ Documents \ Computer Science \ Software   工程\项目\移动应用程序\ app \ src \ main \ res \ values \ strings.xml:   错误:在以下位置多次找到项目字符串/用户名   com.android.build.gradle.tasks.MergeResources.doFullTask​​Action(MergeResources.java:327)     在   com.android.build.gradle.internal.tasks.IncrementalTask​​.taskAction(IncrementalTask​​.java:106)     在sun.reflect.GeneratedMethodAccessor224.invoke(未知来源)   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:50)     在   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:124)     在   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:113)     在   org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:95)     ... 33更多原因:C:\ Users \ admin \ Documents \ Computer   科学\软件工程\项目\移动   App \ app \ src \ main \ res \ drawable \ Logo.png:错误:“ L”无效   基于文件的资源名称字符:必须基于文件的资源名称   仅包含小写字母a-z,0-9或下划线   C:\ Users \ admin \ Documents \ Computer Science \ Software   工程\项目\移动应用程序\ app \ src \ main \ res \ values \ strings.xml:   错误:在以下位置多次找到项目字符串/用户名   com.android.ide.common.resources.MergingException.throwIfNonEmpty(MergingException.java:152)     在   com.android.ide.common.resources.DataSet.loadFromFiles(DataSet.java:255)     在   com.android.ide.common.resources.ResourceSet.loadFromFiles(ResourceSet.java:55)     在   com.android.build.gradle.tasks.MergeResources.doFullTask​​Action(MergeResources.java:298)     ...还有48个

1 个答案:

答案 0 :(得分:1)

您的可绘制drawable\Logo.png是问题

Logo.png 更改为 logo.png ,Android资源不支持大写。

您可以在日志中看到

  

基于文件的资源名称只能包含小写的a-z,0-9或   下划线