3

jenkins 上的 android 构建失败,而在本地成功运行,下面是构建输出:

:app:compileDebugJavaNote: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

advice defined in hugo.weaving.internal.Hugo has not been applied [Xlint:adviceDidNotMatch]
:app:compileRetrolambdaDebugobjc[91376]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileRetrolambdaDebug'.
> Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1

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

2 回答 2

0

有两个 enviroment_variables 指向不同的 JRE(java 运行时环境)。詹金斯不知道他应该使用哪一个。

可能你在 Jenkins 中设置了一个 enviroment_variable,在哪里可以找到 JRE。但与此同时,运行 jenkins 的操作系统也有一个 enviroment_variable,它指向可以找到 JRE 的其他位置。

由您决定要删除其中的哪一个。

于 2015-06-01T17:24:33.090 回答
0

尝试像这样构建您的项目,分两步:

./gradlew prepareDebugDependencies
./gradlew assembleDebug

有关原因的讨论,请参见https://github.com/evant/gradle-retrolambda/issues/105 。

另外(可能对其他人有帮助),请确保您已设置类似于此的环境变量:

export JAVA7_HOME=/usr/lib/jvm/java-7-oracle
export JAVA8_HOME=/usr/lib/jvm/java-8-oracle
export JAVA_HOME=$JAVA7_HOME
于 2015-09-16T13:40:32.287 回答