由于AppCompat-v7 9补丁映像,Jenkins构建在Jenkins中失败,但在本地构建时会传递

时间:2017-11-14 11:58:32

标签: android jenkins gradle

升级gradle版本后:

dependencies {
    classpath 'com.android.tools.build:gradle:3.0.0'
}

jenkins构建开始失败。但是构建仍然在本地机器上取得成功。错误如下:

C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-23.4.0.aar\6abe4391fc97307e05e4ad56d2401e4b\res\drawable-mdpi-v4\abc_ic_menu_cut_mtrl_alpha.png: error: file not found.

C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-23.4.0.aar\6abe4391fc97307e05e4ad56d2401e4b\res\drawable-mdpi-v4\abc_btn_rating_star_on_mtrl_alpha.png: error: file not found.

C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-23.4.0.aar\6abe4391fc97307e05e4ad56d2401e4b\res\drawable-mdpi-v4\abc_ab_share_pack_mtrl_alpha.9.png: error: file not found.

C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-23.4.0.aar\6abe4391fc97307e05e4ad56d2401e4b\res\drawable-hdpi-v4\abc_textfield_activated_mtrl_alpha.9.png: error: file not found.

C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-23.4.0.aar\6abe4391fc97307e05e4ad56d2401e4b\res\anim\abc_slide_out_bottom.xml: error: file not found.

C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-23.4.0.aar\6abe4391fc97307e05e4ad56d2401e4b\res\drawable-hdpi-v4\abc_list_pressed_holo_light.9.png: error: file not found.

C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-23.4.0.aar\6abe4391fc97307e05e4ad56d2401e4b\res\drawable-xxxhdpi-v4\abc_ic_star_black_36dp.png: error: file not found.

C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-23.4.0.aar\6abe4391fc97307e05e4ad56d2401e4b\res\color-v23\abc_color_highlight_material.xml: error: file not found.

还有另一组错误如下:

Error: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.AaptException: 
AAPT err(Facade for 26900479): \\?\C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-23.4.0.aar\6abe4391fc97307e05e4ad56d2401e4b\res\drawable-mdpi-v4\abc_list_selector_disabled_holo_dark.9.png ERROR: Unable to open PNG file
AAPT err(Facade for 2056119429): \\?\C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-23.4.0.aar\6abe4391fc97307e05e4ad56d2401e4b\res\drawable-xhdpi-v4\abc_btn_switch_to_on_mtrl_00012.9.png ERROR: Unable to open PNG file
AAPT err(Facade for 2056119429): \\?\C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-23.4.0.aar\6abe4391fc97307e05e4ad56d2401e4b\res\drawable-hdpi-v4\abc_spinner_mtrl_am_alpha.9.png ERROR: Unable to open PNG file
AAPT err(Facade for 1666675794): \\?\C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-23.4.0.aar\6abe4391fc97307e05e4ad56d2401e4b\res\drawable-xxhdpi-v4\abc_list_pressed_holo_dark.9.png ERROR: Unable to open PNG file
AAPT err(Facade for 2056119429): \\?\C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-23.4.0.aar\6abe4391fc97307e05e4ad56d2401e4b\res\drawable-xxhdpi-v4\abc_menu_hardkey_panel_mtrl_mult.9.png ERROR: Unable to open PNG file
AAPT err(Facade for 26900479): \\?\C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-23.4.0.aar\6abe4391fc97307e05e4ad56d2401e4b\res\drawable-hdpi-v4\abc_list_pressed_holo_dark.9.png ERROR: Unable to open PNG file
AAPT err(Facade for 26900479): \\?\C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-23.4.0.aar\6abe4391fc97307e05e4ad56d2401e4b\res\drawable-xxxhdpi-v4\abc_switch_track_mtrl_alpha.9.png ERROR: Unable to open PNG file
AAPT err(Facade for 812880108): \\?\C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-23.4.0.aar\6abe4391fc97307e05e4ad56d2401e4b\res\drawable-xxxhdpi-v4\abc_btn_switch_to_on_mtrl_00012.9.png ERROR: Unable to open PNG file
AAPT err(Facade for 2051797348): \\?\C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-23.4.0.aar\6abe4391fc97307e05e4ad56d2401e4b\res\drawable-xhdpi-v4\abc_list_pressed_holo_light.9.png ERROR: Unable to open PNG file
AAPT err(Facade for 812880108): \\?\C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-23.4.0.aar\6abe4391fc97307e05e4ad56d2401e4b\res\drawable-hdpi-v4\abc_menu_hardkey_panel_mtrl_mult.9.png ERROR: Unable to open PNG file
AAPT err(Facade for 26900479): \\?\C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-23.4.0.aar\6abe4391fc97307e05e4ad56d2401e4b\res\drawable-hdpi-v4\abc_scrubber_primary_mtrl_alpha.9.png ERROR: Unable to open PNG file
AAPT err(Facade for 26900479): \\?\C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-23.4.0.aar\6abe4391fc97307e05e4ad56d2401e4b\res\drawable-hdpi-v4\abc_list_focused_holo.9.png ERROR: Unable to open PNG file
AAPT err(Facade for 26900479): \\?\C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-23.4.0.aar\6abe4391fc97307e05e4ad56d2401e4b\res\drawable-xxhdpi-v4\abc_list_selector_disabled_holo_light.9.png ERROR: Unable to open PNG file

我尝试了许多SO问题提出的许多解决方案,但没有任何效果。以下是我尝试的解决方案。

1. Changed the build directory thinking the path is too long for Windows.
2. Disabled build cache in gradle.properties.
3. AAPT2 made it to true and false for checking whether that is causing.

2 个答案:

答案 0 :(得分:0)

我有同样的问题。我找到了答案,并确认它是正确的。

禁用构建缓存可能会损害您的开发效率。尝试将jenkins中的环境变量GRADLE_USER_HOME设置到另一个文件夹,例如c:/ Users / someuser

答案 1 :(得分:0)

是的,同样的问题,我也尝试了这3个解决方案来绕过该问题(如作者所述)-它们都没有得到积极的结果。

对我有什么帮助-将项目的jenkins设置中的环境变量GRADLE_USER_HOME更改到另一个文件夹(在我的情况下是C:\ temp \ jenkins)。谢谢@Raul Yang!

有助于在Jenkins中运行app:mergeDebugResources gradle(v5.2)任务时成功完成。