[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 绘图功能出现的类似错误也可以用这个办法解决
参考
[*]B.4 Error: ava.lang.NoClassDefFoundError: Could not initialize>
[*]Gradle build fails with NoClassDefFoundError for sun.awt.X11GraphicsEnvironment in :mergeDebugResources
[*]Could not initialize>验证码无法显示,服务器端出现异常:Could not initialize>
页:
[1]