gradle升级到2.3,出现的编译错误

来源:互联网 发布:美丽港发型设计软件 编辑:程序博客网 时间:2024/05/01 09:04

http://stackoverflow.com/questions/42622654/some-file-crunching-failed-mergedebugresources-failed

Error: Some file crunching failed, see logs for details:app:mergeDebugResources FAILED
AAPT: \\?\C:\Users\任\.android\build-cache\41cfce3bb6e2ca4b269727fe91725c24a067ec68\output\res\drawable-mdpi-v4\abc_btn_switch_to_on_mtrl_00012.9.png ERROR: Unable to open PNG fileAAPT: \\?\C:\Users\任\.android\build-cache\41cfce3bb6e2ca4b269727fe91725c24a067ec68\output\res\drawable-xxhdpi-v4\abc_ic_star_half_black_48dp.png ERROR: Unable to open PNG fileAAPT: \\?\C:\Users\任\.android\build-cache\41cfce3bb6e2ca4b269727fe91725c24a067ec68\output\res\drawable-hdpi-v4\abc_ic_menu_share_mtrl_alpha.png ERROR: Unable to open PNG fileAAPT: \\?\C:\Users\任\.android\build-cache\41cfce3bb6e2ca4b269727fe91725c24a067ec68\output\res\drawable-xxhdpi-v4\abc_text_select_handle_middle_mtrl_light.png ERROR: Unable to open PNG file


解决

problem solved. The solution is here.

Related data as below:
1. According to release notes of Android Studio version 2.3, build cache is enabled by default.
2. so we should disable this setting. Here is official guide, Android Studio/User Guide/build-cache(linkhttps://developer.android.com/studio/build/build-cache.html).
3. go to gradle.properties file, and disable build cache.

// To re-enable the build cache, either delete the following// line or set the property to 'true'.android.enableBuildCache=false

the other way is to modify build cache dir by adding

# first line can be skipped because true is the default value by 2.3android.enableBuildCache=trueandroid.buildCacheDir =c:\\temp\\


0 0
原创粉丝点击