Questions tagged [retrolambda]

Retrolambda is a backport of Java 8's lambda expressions to Java 7, 6 and 5

Retrolambda lets you run Java 8 code with lambda expressions, method references and try-with-resources statements on Java 7, 6 or 5. It does this by transforming your Java 8 compiled bytecode so that it can run on an older Java runtime. After the transformation they are just a bunch of normal .class files, without any additional runtime dependencies.

The GitHub project can be found here: https://github.com/orfjackal/retrolambda

103 questions
3
votes
1 answer

How to use Android’s DrawerLayout.DrawerListener in a lambda expression?

I've been exploring the concept of lambdas and how they provide a simpler syntax while implementing functional interfaces. As per this article, if there is one method it's quite easy to implement the lambda. So, interface OnClickListener { …
Saifur Rahman Mohsin
  • 929
  • 1
  • 11
  • 37
3
votes
1 answer

Lint crashes on a Java class reading a Kotlin object

I have a Kotlin data class: data class InterviewCreation( val candidateId: String, val offerId: String, val startingDateTime: Long, val duration: Long, val location: String, val description: String? ) and a Mapper class…
3
votes
0 answers

Retrolambda/Multimodule confusion

I am using retrolambda and some tests got me quite confused. My understanding is: with retrolambda I can use some java8 language features (e.g. lambdas), but not java 8 classes: e.g. without any additional libraries, I cannot use the java8 streams:…
TmTron
  • 17,012
  • 10
  • 94
  • 142
3
votes
3 answers

Execution failed for task ':app:compileRetrolambdaDebug'

I use retrolambda a long time, but suddenly he stopped working in all my projects. I reinstalled jdk, but it didn't help. I didn't find answer in google, i hope you can help me. My gradle files: build.gradle (app): apply plugin:…
promerbay
  • 41
  • 1
  • 2
3
votes
1 answer

How would you iterate through a list in retrolambda?

I have the following code List trailers = response.body().getResults(); trailers.stream().forEach(trailer -> { View reviewView = LayoutInflater.from(mContext).inflate(R.layout.trailer_list_item, null); ((TextView)…
Strahinja Ajvaz
  • 2,521
  • 5
  • 23
  • 38
3
votes
1 answer

Retrolambda 3.3 in Android Studio 2.1.3: error configuring project ':app'

I configured my project (Module:app) in Android Studio 2.1.3 (Windows 7) (plugin classpath 'com.android.tools.build:gradle:2.1.3') buildscript { repositories { maven { url 'https://maven.fabric.io/public' } mavenCentral() } …
BillyGL
  • 83
  • 2
  • 9
3
votes
1 answer

retrofit 2.0 xml simplexml converter issue while having retrolambda in gradle file

Here is my gradle file apply plugin: 'com.android.application' apply plugin: 'me.tatarka.retrolambda' android { compileSdkVersion 23 buildToolsVersion "23.0.2" defaultConfig { applicationId "com.demo.sample" …
prashant
  • 3,570
  • 7
  • 40
  • 50
3
votes
1 answer

System.getenv() Not Pulling Any Env Vars in Android Studio?

I'm using retrolambda in an Android project. I set two env variables for export in my .bashrc, JAVA7_HOME and JAVA8_HOME that point to the absolute paths of both Java SDKs, after which I source'd .bashrc again. However, trying to compile my project…
Rome_Leader
  • 2,518
  • 9
  • 42
  • 73
3
votes
1 answer

Use lambda expression to create an AlertDialog

I have my Android studio set with these: classpath "me.tatarka:gradle-retrolambda:3.2.2" classpath 'me.tatarka.retrolambda.projectlombok:lombok.ast:0.2.3.a2' And I am trying to use lambdas to know what I can do or not. When I did the…
DeMarco
  • 599
  • 1
  • 8
  • 26
3
votes
2 answers

gradle build failing using Retrolambda on jenkins

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…
rahul.ramanujam
  • 5,608
  • 7
  • 34
  • 56
2
votes
1 answer

CodenameOne app build giving Retrolambda IllegalArgumentException

Whenever I try uploading my CodenameOne app to the build server, it is responding with an error, see below: 00:00 ERROR: Failed to run Retrolambda java.lang.IllegalArgumentException at…
2
votes
0 answers

Suppress Android Gradle Plugin's warning when intentionally using Retrolambda?

I am using the Gradle Retrolambda Plugin in my Android library. The integration works well. The Android Gradle Plugin, however, is annoying me. It announces that it can support Java 8 features, via de-sugaring. It suggests that I stop using…
Jameson
  • 6,400
  • 6
  • 32
  • 53
2
votes
0 answers

How to use lambda with Java 7, strange Retrolambda not working

This is rly strange. In official documetation library retrolambda we can read just put this into own gradle: buildscript { repositories { mavenCentral() } dependencies { classpath 'me.tatarka:gradle-retrolambda:3.7.0' …
companyn2
  • 85
  • 1
  • 9
2
votes
1 answer

How to configure retrolambda for android6(API23)

I want to add Java8 support to my project. The only suitable solution I found is retrolambda gradle plugin project. Here is my build.gradle files for a project and module relatively. Note: Please don't suggest migrate to Android Studio 3, because I…
slesh
  • 1,902
  • 1
  • 18
  • 29
2
votes
1 answer

Multidex throws java.lang.NoClassDefFoundError, RxJava, Retrolambda

I decided to create test example: multidex true (1.0.1), rxjava 2.1.0, retrolambda 3.6.0 So I see bug on Android 4-6 Android 4 06-20 21:13:05.736 4123-4123/? E/AndroidRuntime: FATAL EXCEPTION: main …
daimonkor
  • 59
  • 1
  • 11