Gradle build failure using Retrolambda on jenkins

Android build error on jenkins when running successfully locally, below is the build result:

: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.

      

+3


source to share


2 answers


There are two enviroment_variables that point to different JREs (java runtime). Jenkins doesn't know which one he should be using.

You may have installed enviroment_variable in Jenkins where the JRE can be found. But at the same time, you have an OS that is running jenkins, there is also an enviroment_variable which points to another location where the JRE can be found.



It is up to you which ones you want to remove.

0


source


Try to build your project like this:

./gradlew prepareDebugDependencies
./gradlew assembleDebug

      

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



Also (useful for others, maybe), make sure you set up environment variables like this:

export JAVA7_HOME=/usr/lib/jvm/java-7-oracle
export JAVA8_HOME=/usr/lib/jvm/java-8-oracle
export JAVA_HOME=$JAVA7_HOME

      

0


source







All Articles