Android Studio debugger not stopping at breakpoints in specific file

Viewed 1585

I'm having a strange issue where the Android debugger isn't stopping at breakpoints in one of my files. I have two classes/files Foo and Bar that are both in the same module but different packages. For some reason the debugger skips over any breakpoints set in the Bar.java file while it stops at all the ones in Foo.java.

Below is an example of a method in the Foo.java file that calls a method from the Bar.java file.

private void foo(String str){
    if (str.length > 0) {
        Bar.getInstance().bar();
    }
}

When I set breakpoints on any of the lines in the foo() method the debugger stops on them, but any breakpoints set inside the Bar.java file or in the bar() method don't get recognized or stopped at.

I am positive that the code execution reaches the Bar.getInstance().bar() line as I am able to set a breakpoint there (inside the Foo.java) file and I'm also able to set one at the if statement and step forward until I get to the Bar.getInstance().bar() line.

What is even stranger is that I am able to step into Bar.getInstance().bar() with the debugger and view the values of all of the Bar singleton's instance variables except their names are just letters (screenshot attached).

enter image description here

Usually when you step into something with the debugger the IDE moves to the line in whichever file you're stepping into so you can follow long, in this case it just stays where it was. I also have tried having the debugger stop at a breakpoint in foo() and then I click the Resume Program button (green triangle pointing right) to see if it will then stop at one of the breakpoints in bar() but that doesn't work either.

Then only other information I can think that is relevant is that all this is taking place inside of an IME service. The foo class is the one that extends InputMethodService and is declared in my app's manifest file.

Any help is greatly appreciated!

1 Answers

I sort of figured it out. Turns out minifyEnabled was set to true in my app's gradle file and unset it the module with foo and bar classes. I set both to false and it resolved the issue. Not sure why it was working in one of the files and not the other since they are in the same module but I guess it's resolved enough for me to continue working.

Related