2016-04-22 53 views
0

在使用Gradle版本2.10更新Android Studio 2.0之后,我得到了下面提到的问题。AAPT错误:libpng错误:不是PNG文件

注意:相同的项目在Android Studio中2.0做工精细用摇篮版本2.8

我审查我的所有图像,不知道会是什么问题。

同样的问题张贴在code.google.com

Information:Gradle tasks [clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies] 
:app:clean 
:app:preBuild UP-TO-DATE 
:app:preDebugBuild UP-TO-DATE 
:app:checkDebugManifest 
:app:preReleaseBuild UP-TO-DATE 
:app:prepareAppcorlibAdaptersReleaseLibrary 
:app:prepareAppcorlibAmpReleaseLibrary 
:app:prepareAppcorlibNetClientReleaseLibrary 
:app:prepareAppcorlibReleaseLibrary 
:app:prepareAppcorlibRtfconverterReleaseLibrary 
:app:prepareAppcorlibTradingReleaseLibrary 
: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 err(Facade for 1563428392): libpng error: Not a PNG file 
Error:Execution failed for task ':app:mergeDebugResources'. 
> Some file crunching failed, see logs for details 
Information:BUILD FAILED 
Information:Total time: 3.951 secs 
Information:1 error 
Information:0 warnings 
Information:See complete output in console 
+0

那是1563428392的资源ID吗?如果是这样,你可以检查什么资源给你这个错误。 –

+0

@PedroOliveira不,它不是一个资源ID。 – Srinivasan

+0

你可以将它转换为十六进制,并尝试在R.java中找到它。 –

回答

0

最后,我决定用这个链接refer link

转到终端的帮助的问题,并执行以下提到的命令来了解详情问题

gradlew assembleDebug --info 

它会显示有关问题或警告的信息。在我的项目中,我遇到了一些问题,例如一些文件处理失败的问题。

步骤来解决:

1.安装ImageMagick的工具download

2.To从PNG图像删除ICCP块

Click down the "Shift" key and right click on the folder which is having images 

    Select "Open command window here" option 

    In the command terminal type `mogrify *.png` 

(例如d:\ AndroidProjects {your_project_folder} \ app \ src \ main \ res \ drawable-hdpi> mogrify * .png)

3.现在到您的项目终端执行命令gradlew assembleDebug --info,希望你所有的警告和未能转换的问题都被删除。

快乐编码..