为什么在将可绘制文件重命名为.9 png后,文件处理失败?

内容来源于 Stack Overflow,并遵循CC BY-SA 3.0许可协议进行翻译与使用

  • 回答 (2)
  • 关注 (0)
  • 查看 (111)

我正在测试9补丁图像。

在一切顺利之前,我重新命名drawable档案ic_button_beat_box_default.pngic_button_beat_box_default.9.png,然后我就会出错:

某些文件处理失败,请参阅日志获取详细信息。

然后我重新命名,它正常工作。这是怎么发生的?

完全错误是:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Some file crunching failed, see logs for details

* Try:
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:mergeDebugResources'.
    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)
    ...
Caused by: java.lang.RuntimeException: Some file crunching failed, see logs for details
    at com.android.builder.png.QueuedCruncher.waitForAll(QueuedCruncher.java:260)
    at com.android.builder.png.QueuedCruncher.end(QueuedCruncher.java:280)
    at com.android.ide.common.res2.MergedResourceWriter.end(MergedResourceWriter.java:132)
    at com.android.ide.common.res2.DataMerger.mergeData(DataMerger.java:291)
    at com.android.ide.common.res2.ResourceMerger.mergeData(ResourceMerger.java:48)
    at com.android.build.gradle.tasks.MergeResources.doIncrementalTaskAction(MergeResources.java:250)
    at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:124)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(AnnotationProcessingTaskFactory.java:244)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:220)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(AnnotationProcessingTaskFactory.java:231)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:209)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
    ... 57 more
提问于
用户回答回答于

在Windows上,我遇到了一个“构建失败,无法处理文件”路径“错误并通过关闭AndroidStudio项目来解决它,将整个项目文件夹复制到一个目录路径较短的位置,例如MyC:文件夹,然后在新位置打开项目。希望能帮上忙

用户回答回答于

当我将图像保存在解决了9个补丁工具的问题时,我只更改了文件名,就有了同样的问题。

扫码关注云+社区