任务 ':app:mergeDebugResources' 的 Jenkins 执行失败

Jenkins Execution failed for task ':app:mergeDebugResources'

C:\Windows\System32\config\systemprofile\.gradle\caches\transforms- 1\files-1.1\android.joda- 
2.9.9.aar\ea8536b41f1a30977c6eb9e2a69abab6\res\raw\joda_europe_rome:error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\countrycodepicker2.1.8.aar603d6dbd075925a1391bd7fdd64182\res\drawable-nodpi-v4\flag_italy.png: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms1\files-1.1\play-services-base-15.0.1.aar\e0ce73ced9f39c80bc3766966493b494\res\drawable-xxhdpi-v4\common_google_signin_btn_icon_light_normal_background.9.png: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\play-services-base-15.0.1.aar\e0ce73ced9f39c80bc3766966493b494\res\drawable-hdpi-v4\common_google_signin_btn_icon_dark_normal_background.9.png: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\android.joda-2.9.9.aar\ea8536b41f1a30977c6eb9e2a69abab6\res\raw\joda_africa_sao_tome: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\android.joda-2.9.9.aar\ea8536b41f1a30977c6eb9e2a69abab6\res\raw\joda_atlantic_jan_mayen: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\android.joda-2.9.9.aar\ea8536b41f1a30977c6eb9e2a69abab6\res\raw\joda_asia_yerevan: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\play-services-base-15.0.1.aar\e0ce73ced9f39c80bc3766966493b494\res\drawable-mdpi-v4\common_google_signin_btn_text_dark_normal_background.9.png: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.0.aarf7a38e210ebf1b2faaa9b2a98a97a4e\res\drawable-hdpi-v4\abc_ic_menu_share_mtrl_alpha.png: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\design-27.1.0.aar3b1ef644582d2cd53a88596384c519\res\layout\design_navigation_item.xml: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.0.aarf7a38e210ebf1b2faaa9b2a98a97a4e\res\layout\abc_action_bar_up_container.xml: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\play-services-base-15.0.1.aar\e0ce73ced9f39c80bc3766966493b494\res\drawable\common_google_signin_btn_text_dark.xml: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\android.joda-2.9.9.aar\ea8536b41f1a30977c6eb9e2a69abab6\res\raw\joda_pacific_wake: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.0.aarf7a38e210ebf1b2faaa9b2a98a97a4e\res\drawable-xhdpi-v4\abc_text_select_handle_middle_mtrl_light.png: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\android.joda-2.9.9.aar\ea8536b41f1a30977c6eb9e2a69abab6\res\raw\joda_europe_athens: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\countrycodepicker-2.1.8.aar603d6dbd075925a1391bd7fdd64182\res\drawable-nodpi-v4\flag_mongolia.png: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\android.joda-2.9.9.aar\ea8536b41f1a30977c6eb9e2a69abab6\res\raw\joda_europe_sofia: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.0.aarf7a38e210ebf1b2faaa9b2a98a97a4e\res\drawable-xhdpi-v4\abc_list_selector_disabled_holo_dark.9.png: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.0.aarf7a38e210ebf1b2faaa9b2a98a97a4e\res\drawable-xhdpi-v4\abc_textfield_search_default_mtrl_alpha.9.png: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\countrycodepicker-2.1.8.aar603d6dbd075925a1391bd7fdd64182\res\drawable-nodpi-v4\flag_united_states_of_america.png: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\android.joda-2.9.9.aar\ea8536b41f1a30977c6eb9e2a69abab6\res\raw\joda_asia_magadan: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.0.aarf7a38e210ebf1b2faaa9b2a98a97a4e\res\drawable\abc_btn_default_mtrl_shape.xml: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\countrycodepicker-2.1.8.aar603d6dbd075925a1391bd7fdd64182\res\drawable-nodpi-v4\flag_costa_rica.png: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.0.aarf7a38e210ebf1b2faaa9b2a98a97a4e\res\color\abc_primary_text_disable_only_material_light.xml: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\countrycodepicker-2.1.8.aar603d6dbd075925a1391bd7fdd64182\res\drawable-nodpi-v4\flag_cape_verde.png: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.0.aarf7a38e210ebf1b2faaa9b2a98a97a4e\res\drawable-ldrtl-xxhdpi-v17\abc_ic_menu_copy_mtrl_am_alpha.png: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\countrycodepicker-2.1.8.aar603d6dbd075925a1391bd7fdd64182\res\drawable-nodpi-v4\flag_macao.png: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\countrycodepicker-2.1.8.aar603d6dbd075925a1391bd7fdd64182\res\drawable-nodpi-v4\flag_sao_tome_and_principe.png: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.0.aarf7a38e210ebf1b2faaa9b2a98a97a4e\res\layout\abc_screen_simple_overlay_action_mode.xml: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\countrycodepicker-2.1.8.aar603d6dbd075925a1391bd7fdd64182\res\drawable-nodpi-v4\flag_papua_new_guinea.png: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.0.aarf7a38e210ebf1b2faaa9b2a98a97a4e\res\color\abc_primary_text_material_light.xml: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\android.joda-2.9.9.aar\ea8536b41f1a30977c6eb9e2a69abab6\res\raw\joda_america_argentina_mendoza: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\play-services-base-15.0.1.aar\e0ce73ced9f39c80bc3766966493b494\res\drawable-xxhdpi-v4\common_google_signin_btn_icon_dark_normal_background.9.png: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\android.joda-2.9.9.aar\ea8536b41f1a30977c6eb9e2a69abab6\res\raw\joda_america_cayenne: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.0.aarf7a38e210ebf1b2faaa9b2a98a97a4e\res\layout\abc_popup_menu_header_item_layout.xml: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.0.aarf7a38e210ebf1b2faaa9b2a98a97a4e\res\drawable-ldrtl-xhdpi-v17\abc_spinner_mtrl_am_alpha.9.png: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.0.aarf7a38e210ebf1b2faaa9b2a98a97a4e\res\drawable-mdpi-v4\abc_text_select_handle_left_mtrl_dark.png: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\android.joda-2.9.9.aar\ea8536b41f1a30977c6eb9e2a69abab6\res\raw\joda_africa_tunis: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\android.joda-2.9.9.aar\ea8536b41f1a30977c6eb9e2a69abab6\res\raw\joda_asia_khandyga: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\android.joda-2.9.9.aar\ea8536b41f1a30977c6eb9e2a69abab6\res\raw\joda_africa_ouagadougou: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\support-media-compat-27.1.0.aarb452b78e1c325eda027fdd2f3c59d27\res\layout\notification_template_lines_media.xml: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\design-27.1.0.aar3b1ef644582d2cd53a88596384c519\res\drawable-v21\avd_show_password.xml: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.0.aarf7a38e210ebf1b2faaa9b2a98a97a4e\res\drawable-xhdpi-v4\abc_list_focused_holo.9.png: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.0.aarf7a38e210ebf1b2faaa9b2a98a97a4e\res\drawable-mdpi-v4\abc_textfield_search_activated_mtrl_alpha.9.png: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.0.aarf7a38e210ebf1b2faaa9b2a98a97a4e\res\drawable-xhdpi-v4\abc_btn_radio_to_on_mtrl_015.png: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\android.joda-2.9.9.aar\ea8536b41f1a30977c6eb9e2a69abab6\res\raw\joda_asia_brunei: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.0.aarf7a38e210ebf1b2faaa9b2a98a97a4e\res\layout\abc_tooltip.xml: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\android.joda-2.9.9.aar\ea8536b41f1a30977c6eb9e2a69abab6\res\raw\joda_asia_choibalsan: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.0.aarf7a38e210ebf1b2faaa9b2a98a97a4e\res\drawable\abc_switch_thumb_material.xml: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\android.joda-2.9.9.aar\ea8536b41f1a30977c6eb9e2a69abab6\res\raw\joda_atlantic_faroe: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\android.joda-2.9.9.aar\ea8536b41f1a30977c6eb9e2a69abab6\res\raw\joda_europe_sarajevo: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\android.joda-2.9.9.aar\ea8536b41f1a30977c6eb9e2a69abab6\res\raw\joda_pacific_nauru: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\android.joda-2.9.9.aar\ea8536b41f1a30977c6eb9e2a69abab6\res\raw\joda_asia_yakutsk: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.0.aarf7a38e210ebf1b2faaa9b2a98a97a4e\res\drawable-ldrtl-xxxhdpi-v17\abc_ic_menu_copy_mtrl_am_alpha.png: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\android.joda-2.9.9.aar\ea8536b41f1a30977c6eb9e2a69abab6\res\raw\joda_europe_prague: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\android.joda-2.9.9.aar\ea8536b41f1a30977c6eb9e2a69abab6\res\raw\joda_europe_andorra: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\android.joda-2.9.9.aar\ea8536b41f1a30977c6eb9e2a69abab6\res\raw\joda_america_winnipeg: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.0.aarf7a38e210ebf1b2faaa9b2a98a97a4e\res\drawable-hdpi-v4\abc_ic_menu_copy_mtrl_am_alpha.png: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.0.aarf7a38e210ebf1b2faaa9b2a98a97a4e\res\drawable-hdpi-v4\abc_cab_background_top_mtrl_alpha.9.png: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\android.joda-2.9.9.aar\ea8536b41f1a30977c6eb9e2a69abab6\res\raw\joda_america_argentina_san_luis: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\android.joda-2.9.9.aar\ea8536b41f1a30977c6eb9e2a69abab6\res\raw\joda_asia_bahrain: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\countrycodepicker-2.1.8.aar603d6dbd075925a1391bd7fdd64182\res\drawable-nodpi-v4\flag_georgia.png: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.0.aarf7a38e210ebf1b2faaa9b2a98a97a4e\res\anim\abc_tooltip_enter.xml: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.0.aarf7a38e210ebf1b2faaa9b2a98a97a4e\res\drawable-xhdpi-v4\abc_cab_background_top_mtrl_alpha.9.png: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\android.joda-2.9.9.aar\ea8536b41f1a30977c6eb9e2a69abab6\res\raw\joda_asia_famagusta: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\countrycodepicker-2.1.8.aar603d6dbd075925a1391bd7fdd64182\res\drawable-nodpi-v4\flag_dominican_republic.png: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.0.aarf7a38e210ebf1b2faaa9b2a98a97a4e\res\layout\abc_dialog_title_material.xml: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.0.aarf7a38e210ebf1b2faaa9b2a98a97a4e\res\drawable\abc_spinner_textfield_background_material.xml: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\countrycodepicker-2.1.8.aar603d6dbd075925a1391bd7fdd64182\res\drawable-nodpi-v4\flag_madagascar.png: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\android.joda-2.9.9.aar\ea8536b41f1a30977c6eb9e2a69abab6\res\raw\joda_america_port_of_spain: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.0.aarf7a38e210ebf1b2faaa9b2a98a97a4e\res\anim\abc_popup_exit.xml: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\android.joda-2.9.9.aar\ea8536b41f1a30977c6eb9e2a69abab6\res\raw\joda_america_regina: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\countrycodepicker-2.1.8.aar603d6dbd075925a1391bd7fdd64182\res\drawable-nodpi-v4\flag_tibet.png: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\android.joda-2.9.9.aar\ea8536b41f1a30977c6eb9e2a69abab6\res\raw\joda_asia_amman: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\android.joda-2.9.9.aar\ea8536b41f1a30977c6eb9e2a69abab6\res\raw\joda_africa_abidjan: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\countrycodepicker-2.1.8.aar603d6dbd075925a1391bd7fdd64182\res\drawable-nodpi-v4\flag_taiwan.png: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\android.joda-2.9.9.aar\ea8536b41f1a30977c6eb9e2a69abab6\res\raw\joda_asia_baku: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\android.joda-2.9.9.aar\ea8536b41f1a30977c6eb9e2a69abab6\res\raw\joda_asia_sakhalin: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\android.joda-2.9.9.aar\ea8536b41f1a30977c6eb9e2a69abab6\res\raw\joda_pacific_easter: error: file not found.
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\android.joda-2.9.9.aar\ea8536b41f1a30977c6eb9e2a69abab6\res\raw\joda_america_monterrey: error: file not found.

错误:

java.util.concurrent.ExecutionException:com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs for details :app:mergeDebugResources FAILED

失败:构建失败,出现异常。

出了什么问题:

Execution failed for task ':app:mergeDebugResources'. Error: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs for details

这是旧版 AAPT2(在构建工具中发布)中的错误。 AAPT2 无法读取超过 200 个字符左右的路径,以及包含非 ASCII 字符的路径。

这些问题现在已经修复,所以将您的 android gradle 插件更新到更新版本(3.2-alpha14 或更新版本)应该可以解决问题(现在 AAPT2 已在 gmaven 中发布,所以只需更新 AGP 版本就足够了,无需下载新的构建工具。

在您的 build.gradle 文件中更新您的 android gradle 插件版本并添加 google() maven 存储库:

buildscript {

    repositories {
        google() // add google maven repo
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.0-alpha14' // or newer
    }
}

allprojects {
    repositories {
        google() // don't forget to add google maven here too!
        jcenter()
    }
}

最后我通过设置 GRADLE_USER_HOME 全局属性解决了这个问题 Jenkins > 管理 jenkins > 配置系统 到 c:/gradle-cache

所以肯定与文件路径长度有关