Exception : AAPT2 error: check logs for details

前端 未结 23 1791
走了就别回头了
走了就别回头了 2020-11-27 14:00
Task :processDebugResources Failed to execute aapt com.android.ide.common.process.ProcessException: Failed to execute aapt
    at com.android.builder.core.AndroidBui         


        
23条回答
  •  南方客
    南方客 (楼主)
    2020-11-27 14:48

    Seeing your logs :

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ... 1 more Caused by: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details at com.android.builder.png.AaptProcess$NotifierProcessOutput.handleOutput(AaptProcess.java:454) at com.android.builder.png.AaptProcess$NotifierProcessOutput.err(AaptProcess.java:411) at com.android.builder.png.AaptProcess$ProcessOutputFacade.err(AaptProcess.java:332) at com.android.utils.GrabProcessOutput$1.run(GrabProcessOutput.java:104)

    I feel some PNG files are corrupted and were not parsed. Sometimes the images have an extension but are not real PNG.

    You can check if the images in your project are real PNGs with the below command :

    find . -type f -name "*.png" | xargs -L 1 -I{} file  -I {} | grep -v 'image/png; charset=binary$'
    

    After getting the list use this site to convert them to PNG. Then check your build again.

提交回复
热议问题