Jenkins自动编译常见问题汇总(持续更新)

Jenkins编译log如下(说是Android sdk路径不存在导致的编译失败);

Triggered by Gerrit: http://developer.miivii.com:8081/231
[EnvInject] - Loading node environment variables.
Building in workspace /home/jenkins/workspace/Alaska/MVLauncher2
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url ssh://developer.miivii.com:29418/miivii-sw-android/sdk_v2/apps/MVLauncher2 # timeout=10
Fetching upstream changes from ssh://developer.miivii.com:29418/miivii-sw-android/sdk_v2/apps/MVLauncher2
 > git --version # timeout=10
 > git fetch --tags --progress ssh://developer.miivii.com:29418/miivii-sw-android/sdk_v2/apps/MVLauncher2 refs/changes/*:refs/changes/*
 > git rev-parse refs/changes/31/231/2^{commit} # timeout=10
 > git rev-parse refs/remotes/origin/refs/changes/31/231/2^{commit} # timeout=10
Checking out Revision 53bfb46d3162bd7418e83bd5c8fdc1040cbcd705 (refs/changes/31/231/2)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 53bfb46d3162bd7418e83bd5c8fdc1040cbcd705
First time build. Skipping changelog.
[MVLauncher2] $ /bin/sh -xe /tmp/hudson5326600375543782905.sh
+ ./gradlew assemble
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/2.14.1/userguide/gradle_daemon.html.
useNewCruncher has been deprecated. It will be removed in a future version of the gradle plugin. New cruncher is now always enabled.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> The SDK directory '/home/zlliu/android-sdk-linux' does not exist.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 2.71 secs
Build step 'Execute shell' marked build as failure
Skipped archiving because build is not successful
Finished: FAILURE

解决方案就是删除掉不该push到服务器的文件:

导致我问题的是local.properties文件,删除以后就编译通过了。

当然如果push了其他不该push的文件,又会暴露出其他的编译失败原因,解决办法一样:

git rm local.properties删除

rm -rf .idea/删除

然后再push。


截图:

Jenkins自动编译常见问题汇总(持续更新)_第1张图片

你可能感兴趣的:(Android,疑难杂症)