当前位置: 首页 > 知识库问答 >
问题:

如何修复,错误:任务“:app:MergedebugResources”执行失败。>错误:java.lang.RuntimeException:某些文件处理失败

逑何平
2023-03-14
Executing tasks: [clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies]

Configuration on demand is an incubating feature.
Incremental java compilation is an incubating feature.
:clean UP-TO-DATE
:app:clean
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2421Library
:app:prepareComAndroidSupportAppcompatV72421Library
:app:prepareComAndroidSupportSupportCompat2421Library
:app:prepareComAndroidSupportSupportCoreUi2421Library
:app:prepareComAndroidSupportSupportCoreUtils2421Library
:app:prepareComAndroidSupportSupportFragment2421Library
:app:prepareComAndroidSupportSupportMediaCompat2421Library
:app:prepareComAndroidSupportSupportV42421Library
:app:prepareComAndroidSupportSupportVectorDrawable2421Library
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:generateDebugBuildConfig
:app:generateDebugResValues
:app:generateDebugResources
:app:mergeDebugResources
AAPT err(Facade for 445014223): D:\projects\Intent2\app\build\intermediates\res\merged\debug\drawable-xxhdpi-v4\abc_ic_menu_selectall_mtrl_alpha.png ERROR: Unable to open PNG file
AAPT err(Facade for 445014223): D:\projects\Intent2\app\build\intermediates\res\merged\debug\drawable-xxhdpi-v4\abc_list_selector_disabled_holo_light.9.png ERROR: Unable to open PNG file
AAPT err(Facade for 445014223): D:\projects\Intent2\app\build\intermediates\res\merged\debug\drawable-mdpi-v4\abc_menu_hardkey_panel_mtrl_mult.9.png ERROR: Unable to open PNG file
AAPT err(Facade for 445014223): D:\projects\Intent2\app\build\intermediates\res\merged\debug\drawable-xxxhdpi-v4\abc_spinner_mtrl_am_alpha.9.png ERROR: Unable to open PNG file
AAPT err(Facade for 445014223): D:\projects\Intent2\app\build\intermediates\res\merged\debug\drawable-xxxhdpi-v4\abc_ic_star_half_black_36dp.png ERROR: Unable to open PNG file
AAPT err(Facade for 445014223): D:\projects\Intent2\app\build\intermediates\res\merged\debug\drawable-hdpi-v4\abc_ic_star_black_36dp.png ERROR: Unable to open PNG file
AAPT err(Facade for 445014223): D:\projects\Intent2\app\build\intermediates\res\merged\debug\drawable-hdpi-v4\abc_ic_commit_search_api_mtrl_alpha.png ERROR: Unable to open PNG file
AAPT err(Facade for 445014223): D:\projects\Intent2\app\build\intermediates\res\merged\debug\drawable-mdpi-v4\abc_text_select_handle_middle_mtrl_dark.png ERROR: Unable to open PNG file
AAPT err(Facade for 445014223): D:\projects\Intent2\app\build\intermediates\res\merged\debug\drawable-xhdpi-v4\abc_text_select_handle_left_mtrl_light.png ERROR: Unable to open PNG file
AAPT err(Facade for 445014223): D:\projects\Intent2\app\build\intermediates\res\merged\debug\drawable-ldrtl-hdpi-v17\abc_spinner_mtrl_am_alpha.9.png ERROR: Unable to open PNG file
AAPT err(Facade for 445014223): D:\projects\Intent2\app\build\intermediates\res\merged\debug\drawable-xxhdpi-v4\abc_text_select_handle_left_mtrl_light.png ERROR: Unable to open PNG file
AAPT err(Facade for 445014223): D:\projects\Intent2\app\build\intermediates\res\merged\debug\drawable-mdpi-v4\abc_list_pressed_holo_dark.9.png ERROR: Unable to open PNG file
AAPT err(Facade for 445014223): D:\projects\Intent2\app\build\intermediates\res\merged\debug\drawable-xxhdpi-v4\abc_ic_star_half_black_36dp.png ERROR: Unable to open PNG file
AAPT err(Facade for 445014223): D:\projects\Intent2\app\build\intermediates\res\merged\debug\drawable-xxhdpi-v4\abc_list_focused_holo.9.png ERROR: Unable to open PNG file
AAPT err(Facade for 445014223): D:\projects\Intent2\app\build\intermediates\res\merged\debug\drawable-xxhdpi-v4\abc_btn_switch_to_on_mtrl_00001.9.png ERROR: Unable to open PNG file
AAPT err(Facade for 445014223): D:\projects\Intent2\app\build\intermediates\res\merged\debug\drawable-xxxhdpi-v4\abc_ic_star_black_36dp.png ERROR: Unable to open PNG file
AAPT err(Facade for 445014223): D:\projects\Intent2\app\build\intermediates\res\merged\debug\drawable-xhdpi-v4\abc_ic_menu_copy_mtrl_am_alpha.png ERROR: Unable to open PNG file

Error: java.lang.RuntimeException: Some file crunching failed, see logs for details
:app:mergeDebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Error: java.lang.RuntimeException: Some file crunching failed, see logs for details

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

BUILD FAILED

共有1个答案

胡高寒
2023-03-14

这是由于在drawable中添加了一个扩展名(.jpg)的图像,而您已将其更改或保存为.png格式(在不使用编辑器工具的情况下手动更改图像格式时会出现此错误)。Android studio在使用AAPT(Android Asset Packaging Tool)编译资源包时会抛出一个错误,所以你只需要使用一些类似“Gimp or Paint”的图像编辑器工具来相应地保存扩展即可。完成所有工作后重新构建项目。

例如:在画图工具中打开图像(拖放图像以打开它)->文件->另存为->另存为类型->从下拉菜单中选择所需的类型

来源:https://stackoverflow.com/A/34675557/842607

 类似资料: