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

    xiaoxiao2021-03-25  109

    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\\

    转载请注明原文地址: https://ju.6miu.com/read-10172.html

    最新回复(0)