如何解决,错误:任务':app:mergeDebugResources'的执行失败。 >错误:java.lang.RuntimeException:某些文件崩溃失败

时间:2016-11-22 10:12:24

标签: android performance android-studio

here is screenshot 我尝试过使用最新的gradle版本和 我还将最新的android studio版本更新为2.2,但是在构建项目时一次又一次地发生错误,请建议我。

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 个答案:

答案 0 :(得分:0)

这是因为在drawable中添加了一个像(.jpg)这样的扩展名并且您已将其更改或保存为.png格式的图像(在不使用编辑器工具的情况下手动更改图像格式时会发生此错误) 。 Android Studio在使用AAPT(Android资产包装工具)编译资源包时会抛出错误,因此您只需使用一些图像编辑器工具(如“gimp或paint”)来相应地保存扩展。一切都完成后重建您的项目。

例如:在绘制工具中打开图片(拖放图片以将其打开) - >档案 - >另存为>保存为Type-> 从下拉列表中选择所需类型

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

相关问题