2016-04-22 39 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,希望你所有的警告和未能轉換的問題都被刪除。

快樂編碼..