任务 'app:mergeDebugResources' Crunching Cruncher 的执行失败....png 失败 [英] Execution failed for task 'app:mergeDebugResources' Crunching Cruncher....png failed

查看:21
本文介绍了任务 'app:mergeDebugResources' Crunching Cruncher 的执行失败....png 失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将一些格式为 *.png 的图片添加到我的可绘制目录并将其与布局链接.但是每次我尝试构建它时,都会出现错误

I've added some pictures with the format *.png to my drawable-directory and linked it with the layouts. But every time when I tried to build it, there appears an error

...Crunching Crunching Crunning...png 失败"

"...Crunching Crunsher ...png failed"

以下是控制台的输出:

app:mergeDebugResources
AAPT out(1561599) : No Delegate set : lost message:Done
AAPT out(12956469) : No Delegate set : lost message:Done
AAPT out(20612543) : No Delegate set : lost message:Crunching             C:DevStudioProjects	estandroidappsrcmain
esdrawablet_meeting_focused.png
AAPT out(11030156) : No Delegate set : lost message:Crunching     C:DevStudioProjects	estandroidappsrcmain
esmipmap-mdpiic_launcher.png
AAPT out(11030156) : No Delegate set : lost message:Crunching single PNG file: C:DevStudioProjects	estandroidappsrcmain
esmipmap-    mdpiic_launcher.png
AAPT out(11030156) : No Delegate set : lost message:    Output file:     C:DevStudioProjects	estandroidappuildintermediates
esdebugmipmap-mdpi-v4ic_launcher.png
AAPT out(11030156) : No Delegate set : lost message:Done
AAPT err(11030156): libpng error: Not a PNG file
AAPT out(20612543) : No Delegate set : lost message:Crunching single PNG     file:     C:DevStudioProjects	estandroidappsrcmain
esdrawablet_meeting_focused.png
AAPT out(20612543) : No Delegate set : lost message:    Output file:     C:DevStudioProjects	estandroidappuildintermediates
esdebugdrawable    t_meeting_focused.png
AAPT out(20612543) : No Delegate set : lost message:Done
AAPT err(20612543): libpng error: Not a PNG file
AAPT err(1561599): libpng error: Not a PNG file
AAPT err(12956469): libpng error: Not a PNG file

 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Crunching Cruncher uhr.png failed, see logs

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

BUILD FAILED

Total time: 14.598 secs
Executing tasks: [clean, :app:generateDebugSources,     :app:generateDebugAndroidTestSources]

Configuration on demand is an incubating feature.
:app:clean
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportSupportV42220Library
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:generateDebugBuildConfig
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources
:app:mergeDebugResources
AAPT out(14080484) : No Delegate set : lost message:Done
AAPT out(9206750) : No Delegate set : lost message:Done
AAPT out(25360025) : No Delegate set : lost message:Done
AAPT err(25360025): libpng error: Not a PNG file
AAPT err(14080484): libpng error: Not a PNG file
AAPT out(6423170) : No Delegate set : lost message:Crunching C:DevStudioProjects	estandroidappsrcmain
esdrawableanfrage_senden_.png
AAPT err(6423170): libpng error: Not a PNG file
AAPT out(6423170) : No Delegate set : lost message:Crunching single PNG file:     C:DevStudioProjects	estandroidappsrcmain
esdrawableanfrage_senden_.png
AAPT out(6423170) : No Delegate set : lost message: Output file: C:DevStudioProjects	estandroidappuildintermediates
esdebugdrawablea    nfrage_senden_.png
AAPT out(6423170) : No Delegate set : lost message:Done
AAPT err(9206750): libpng error: Not a PNG file

Process list not empty
:app:mergeDebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Crunching Cruncher uhr.png failed, see logs

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

BUILD FAILED

Total time: 4.325 secs

我尝试清理项目,重建它,通过gradlew clean build --refresh-dependencies"刷新依赖项,但没有任何效果.我已经检查了 build.gradle 文件中的依赖项,但似乎没有任何内容导致错误.

I tried to clean the project, rebuild it, refresh the dependencies via "gradlew clean build --refresh-dependencies", nothing worked. I've checked the dependencies in the build.gradle file but nothing seems creating the error.

   apply plugin: 'com.android.application'
   android {
   compileSdkVersion 22
   buildToolsVersion "22.0.1"
   compileOptions.encoding = 'windows-1251'

   defaultConfig {
       applicationId "com.example.benutzer.test"
       minSdkVersion 16
       targetSdkVersion 22
       versionCode 1
       versionName "1.0"
   }
   buildTypes {
    release {
           minifyEnabled false
           proguardFiles getDefaultProguardFile('proguard-android.txt'),    'proguard-rules.pro'
       }
   }
   }

   dependencies {
   compile 'com.android.support:support-v4:22.2.0'
  }

你有什么想法,错误的根源是什么?文件路径也不会太长,而且每次都有 256 个符号,这也不是问题:/

Do you've got an idea, what's the source of the error? The filepath is also not too long and everytime unter 256 signs, that also not the problem :/

先谢谢你:)

推荐答案

就我而言,错误是由我添加到 drawable 文件夹中的 PNG 文件引起的.我通过更改文本(以不正确的方式)然后将其上传为 PNG,将其扩展名从 jpg 更改为 png.

In my case, the error was caused by a PNG file I added to the drawable folder. I had changed its extension from jpg to png by changing the text (in an inproper way) and then uploading it as PNG.

这是 Android Studio 指出的问题.

This was the problem Android Studio was pointing to.

我解决了这个问题,并通过使用 Paint.NET 更改文件扩展名使错误消失 工具或任何其他工具(正确的方式),然后将其上传到 drawable 文件夹.

I fixed this problem and got the error to disappear by changing the file extension using the Paint.NET tool or any other tool (proper way), and then uploading it to the drawable folder.

这篇关于任务 'app:mergeDebugResources' Crunching Cruncher 的执行失败....png 失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆