[Jenkins] 解决 Gradle 编译包含 SVG Drawable 出现异常

异常信息

java.awt.AWTError: Can't connect to X11 window server using 'localhost:10.0' as the value of the DISPLAY variable.

解决方案

在 Jenkins shell 脚本里调用 gradlew 编译之前,增加如下语句

unset DISPLAY

其他说明

在 gradle 中使用 AWT 绘图功能出现的类似错误也可以用这个办法解决

参考

原文地址:https://www.cnblogs.com/shaobin0604/p/7814272.html