jenkins打包死活过不去
:app:lint FAILED
:app:lint (Thread[Daemon worker,5,main]) completed. Took 9.529 secs.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:lint'.
> Can't connect to X11 window server using 'localhost:10.0' as the value of the DISPLAY variable.
* Try:
Run with --debug option to get more log output.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:lint'.
原因:在打包的时候调用了图形界面报错,但是由于使用的是jekins,它没有权限或是系统不让它掉,所以报错
解决:1,每次开机的时候使用命令行打一次,把X11先调起来,然后把jekins的lint插件禁用。
2、jekins的打包命令clean build -x lint --stacktrace --info -b build.gradle , -x lint 是重点
3、okio在lint验证的时候不通过
http://bbs.reactnative.cn/topic/7/gradlew-build%E6%98%AFlint%E5%87%BA%E7%8E%B0%E9%97%AE%E9%A2%98/2
https://stackoverflow.com/questions/35492259/lint-error-on-okio
(1)在app目录下新建lint.xml 里面为
<?xml version="1.0" encoding="utf-8"?>
<lint>
<issue id="InvalidPackage">
<ignore regexp="okio-1.8.0.jar" />
</issue>
</lint>
(2)在app目录下的build里添加
lintOptions {
checkReleaseBuilds false
abortOnError false
lintConfig file("lint.xml")
}