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

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")
    }

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章