首页 > 解决方案 > Android Studio 3.3 Java 8 debugger "this" is not available in lambdas and cannot stop on "if"

问题描述

I have changed my Android Java version to 8 wanting to simplify some code writing. An issue I am having, and I cannot figure out, is that I am getting a 'this' is not available in the debugger for the class properties when they are inside a lambda expression. As mentioned in the title I have updated to the latest Android Studio 3.3.

I have been searching around for some time now trying to figure out what I am doing wrong but with no luck.

Another issue that I am having is that when in lambdas (and anonymous in general) the debugger cannot stop on if statements (visually the breakpoint red circle never gets a tick mark), something I am pretty sure I could do before. Are there changes (or settings) in Android Studio 3.3 that caused this? What am I missing?

Any ideas/solution would be much appreciated.

EDIT:

There is another question concerning the if breakpoints issue specifically. The OP there gives a very generic answer that I am not satisfied with and it doesn't answer the why.

What I noticed is that the if statements that have complicated logic in them do not get active breakpoints. So an if (object.getSomething() == something) will not work, but if you assign that to a value and then use the value in the comparison it works just fine... mystery deepens.

标签: javaandroidandroid-studiodebugging

解决方案


推荐阅读