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
1
vote
1 answer

can't find enclosing method 'void lambda$getTestFlowable$0(io.reactivex.FlowableEmitter)'

I use RxJava2 and Retrolambda in my project and for some time I felt very good, wrapping callbacks into flowables, but one day I've faced this error and if I try to run proguard on this very simplified code snippet: private Flowable
vrfloppa
  • 374
  • 4
  • 14
1
vote
0 answers

Problems when running application with Jack and Retrolambda

I recently had a lot of problems trying to debug in my application when using Retrolambda, because of that I wanted to include Jack on my Gradle for debugging purposes. jackOptions { enabled true } Because of that, I have been going through this…
1
vote
2 answers

Retrolambda with RealmList

I am trying to access RealmList of model class in forEach loop. Attempt : 1 realmList.forEach(obj -> { System.out.println("value"+obj.getValue())}); Attempt : 2 realmList.forEach((ModelClass obj) -> {…
Akash Patel
  • 2,757
  • 1
  • 22
  • 30
1
vote
1 answer

Lint crashes with an exception during analysis with classes that contain retrolambda

I'm using retrolambda with android-retrolambda-lombok but lint crashes anyway during :app:lintVital** task. These two are in my projects build.gradle and I excluded com.android.tools.external.lombok as in readme. classpath…
Alexander Perfilyev
  • 6,739
  • 2
  • 17
  • 30
1
vote
1 answer

Why this method call can not be converted into lambda?

Consider the following code: recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrolled(RecyclerView recyclerView, int dx, int dy) { //some code here } …
2hamed
  • 8,719
  • 13
  • 69
  • 112
1
vote
1 answer

How can I annotate a lambda with @WorkerThread?

I'm updating some code to use retrolambda on Android. The code mostly works, but the Android Studio 2.1 IDE seems to flag the previously OK code: @WorkerThread void expensiveBackgroundOperation() { // Stuff. } @UiThread void…
Grzegorz Adam Hankiewicz
  • 7,349
  • 1
  • 36
  • 78
1
vote
1 answer

Warning in Android Studio: Can be replaced with collect call

I've recently started using retrolambda library to support lambdas in android development and I received the following warning from Android Studio: Can be replaced with collect call. This inspection reports foreach loops which can be replaced with…
Dmytro Karataiev
  • 1,214
  • 1
  • 14
  • 19
1
vote
0 answers

Android HashMap + Retrolambda

The question is, does using HashMap with Retrolambda results in Java8-like bucket structure - balanced tree? I know that aapt plugin translates Java8 to Java7 bytecode, but they say: Java 8 features other than lambda expressions are not supported…
Le_Enot
  • 799
  • 6
  • 16
1
vote
1 answer

How do I write this without 'retrolambda' syntax?

I am 100% new to Java and I'm trying to add Crashlytics to my React Native project. The only code snippet I could find on the internet is retrolambda syntax. I realize I could add that particular "library" or whatever, so it works, but considering…
Tallboy
  • 12,847
  • 13
  • 82
  • 173
1
vote
1 answer

Bug with eclipse when using retrolambda and Android

We're using gradle for builds, but writing with Eclipse. I have retrolambda working fine, eclipse sees the lambda syntax and is OK, gradle builds and runs perfectly. The pnly problem is that Eclipse marks the files as having errors, with the 'p' of…
yedidyak
  • 1,964
  • 13
  • 26
1
vote
2 answers

Using 'this' keyword with Retrolambda

I have a problem with this code: view.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { @Override public void onGlobalLayout() { if (android.os.Build.VERSION.SDK_INT >=…
Abdelrhman Talat
  • 1,205
  • 2
  • 13
  • 25
1
vote
2 answers

Retrolambda Requirement for Java 8 Causing :mobile:dexDebug' Exception

Having big problems trying to get retrolambda working in my project. There are plenty of sex issues and solutions out there but I haven't found any that doesn't resort to adding the multiDexEnabled flag to the grade file. I am getting the following…
StuStirling
  • 15,601
  • 23
  • 93
  • 150
1
vote
1 answer

Not getting BehaviourSubject

I have done android pretty much but new to java 8. I have made a BehaviourSubject< Map< String,String>>. I have put an observable on it. From presenter class I am setting BehaviourSbuject as observable and as soon as onClick is made the onNext is…
Vikas Chandra
  • 565
  • 1
  • 9
  • 22
1
vote
1 answer

Getting error in retrolambda error in android studio 1.0

I am working in android studio 1.0 the gradle file is showing this error: Execution failed for task ':app:compileRetroLambdaDebug' apply plugin: 'android' apply plugin: 'retrolambda' android { compileSdkVersion 21 buildToolsVersion…
Vikas Chandra
  • 565
  • 1
  • 9
  • 22
0
votes
0 answers

Errors related to lack of support java 8 despite Retrolambda

I followed this readme https://github.com/evant/gradle-retrolambda I added classpath 'me.tatarka:gradle-retrolambda:3.7.1' to gradle.build and apply plugin: 'me.tatarka.retrolambda' to gradle.build (app) and android { compileOptions { …
jdev
  • 25
  • 3