3

android build failing on jenkins while runs successfully locally , below is the build output :

: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.
rahul.ramanujam
  • 5,608
  • 7
  • 34
  • 56
  • 1
    Did you manage to fix this? Currently having the same issue, don't think it's the multiple JREs as I get that error locally when it passes too. – RyanJohnstone Aug 06 '15 at 14:29
  • I did some research and it seemed to be a bug on the java side which was open for while, I will share the link once I get it . Currently, Running the build again after encountering this issue, fixes it. Not sure of the exact root cuase , I suppose it executes some code randomly which causes this issue. – rahul.ramanujam Aug 06 '15 at 14:39
  • 1
    Seems to be failing consistently for me right now, was fine two days ago :/ – RyanJohnstone Aug 06 '15 at 14:53
  • Solved the nearly same issue, updating the version of `gradle-retrolambda` plugin from `3.1.0` to `3.2.2` (latest). – findall Sep 09 '15 at 09:46
  • I fixed this issue by adding compile 'io.reactivex:rxjava:1.0.14' to my gradle dependencies. Not sure is it your case though. – AlexeyGorovoy Sep 11 '15 at 11:55

2 Answers2

0

There are two enviroment_variables which point to different JREs (java runtime enviroment). Jenkins do not know which of them he should use.

probably you have set an enviroment_variable in Jenkins, where to find an JRE. But at the same time, you OS on which the jenkins is runnung, has also an enviroment_variable, which points to other location where to find the JRE.

Its up to you which of them you want to remove.

Paul Reznik
  • 965
  • 1
  • 6
  • 18
0

Try building your project like this, in two steps:

./gradlew prepareDebugDependencies
./gradlew assembleDebug

See https://github.com/evant/gradle-retrolambda/issues/105 for the discussion about the reason for this.

Also (helpful for other, maybe), make sure you have set up your environment variables similar to this:

export JAVA7_HOME=/usr/lib/jvm/java-7-oracle
export JAVA8_HOME=/usr/lib/jvm/java-8-oracle
export JAVA_HOME=$JAVA7_HOME
espinchi
  • 9,144
  • 6
  • 58
  • 65