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

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 file
AAPT: \\?\C:\Users\任\.android\build-cache\41cfce3bb6e2ca4b269727fe91725c24a067ec68\output\res\drawable-xxhdpi-v4\abc_ic_star_half_black_48dp.png ERROR: Unable to open PNG file
AAPT: \\?\C:\Users\任\.android\build-cache\41cfce3bb6e2ca4b269727fe91725c24a067ec68\output\res\drawable-hdpi-v4\abc_ic_menu_share_mtrl_alpha.png ERROR: Unable to open PNG file
AAPT: \\?\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.3
android.enableBuildCache=true
android.buildCacheDir =c:\\temp\\


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值