AAPT错误:libpng错误:不是PNG文件

时间:2016-04-22 07:42:14

标签: android android-studio

使用Gradle版本2.10更新Android Studio 2.0后,我在下面提到了这个问题。

注意:使用Gradle版本2.8在Android Studio 2.0中正常运行的项目

我已经查看过我的所有图片,不知道会出现什么问题。

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

1 个答案:

答案 0 :(得分:0)

最后,我借助此链接refer link

解决了这个问题

转到终端并执行下面提到的命令以了解有关问题的详细信息

gradlew assembleDebug --info

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

要解决的步骤:

1.安装ImageMagick工具download

2.从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,希望您的所有警告和转换失败的问题都被删除。

快乐编码..