1

I have a problem Compiling my program when I add some class in Kotlin in it. When I do a clean of the project, and Start running it, the next error is prompt:

Error:Execution failed for task ':app:compileRetrolambdaMyProject'.

Process 'command '/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java'' finished with non-zero exit value 1

The thing is that if I execute again the project it works perfectly. So basically I have to build the project twice in order to execute the project.

I need this to be fixed because I build the final version in Jenkins and this is giving me problems.

Any clues on how to fix it?

Edit:

This are the unique warnings that it gives me, but as I said, they are warnings, not errors, and if I Run again the project it works perfectly :

Warning:(31, 57) Parameter 'buttonView' is never used, could be renamed to _
Warning:(40, 46) Parameter 'v' is never used, could be renamed to _
Warning:(56, 48) Parameter 'v' is never used, could be renamed to _
Error:Execution failed for task ':app:compileRetrolambdaMyProject'.
> Process 'command '/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
Alvaro
  • 491
  • 3
  • 16

2 Answers2

0

The problem was with RetroLambda Library, following this issue on Github: https://github.com/evant/gradle-retrolambda/issues/105

The solution is to add :

retrolambda {
    jvmArgs '-noverify'
}

to my gradle, and upgrading the Retrolambda library to version 3.7.0.

Alvaro
  • 491
  • 3
  • 16
0

I also had this problem and tried the following things:

via Android Studio:

  • Build > Clean Project
  • File > Invalidate Caches / Restart

via command line:

  • ./gradlew build --refresh-dependencies

These three approaches solved most of the problems like this I had before, but in this case the only thing that helped was to delete all build folders in my project manually (build folder in project root and in all modules like app and others if you have more).

Julia Hexen
  • 695
  • 3
  • 10