Water debugging Android 11

This was indirectly logged last week as bugs://85159, but I wanted to start a new thread to so that I can help provide any info I need to on this. I’ve been having serious issues getting the debugger to connect for a long time (probably 10-20% success rate) but now I seem to be entirely unable to connect the debugger on my last 20-30 attempts. The only change I can think of is that I updated my phone that I’m attempted to debug on (a Pixel 3, updated to the latest Android 11 patch).

Is there anything I can do to test to provide more info on this and get it fixed quicker? I really need this to be fixed.


does this fail for device and emulators, or just for the real device? in any case, I’ll make sure this gets top priority tomorrow.

1 Like

Both. I seem to have more luck with one than the other at different times, but both fail frequently. I should also note, it appears to be something specific to my project, as I am able to debug other projects without issue. The project that I have issues with is a multi-project solution (an Android project, a Test project, and a shared project with code used by each) for a multidexed Android app, targeting Android api 29.



We also can’t reproduce the issue. Is it possible to get a testcase, maybe simplified version of your project, reproducing the problem?

Hi, thanks! I’ve been working on that already today but then ran into this issue. I’m working to get a simplified version of my project in a way that avoids triggering the other bug :confused:

I’ve been playing around with this, trying to get a reproducible test case. It looks like if the Firebase Analytics library is included, the app throws a lot of exceptions at startup while debugging. The exceptions are non-fatal but show up if I do not enable “ignore exceptions.” But the app hangs indefinitely somewhere in the launch of the Android Application/Activity lifecycle. As best as I can tell at the moment, setting the Firebase Analytics dependency to only be included in Release builds seems to avoid the hang. Here’s a sample project.

com.debughang.zip (36.2 KB)

Two things to note. First, I’m dealing with two other unrelated bugs (here and here) that are making it impossible to consistently build projects to test this at the moment. Hopefully this sample project helps for now. Second, I’ve only added Firebase Analytics in the past few months, but I’ve been having persistent issues getting the debugger to connect for a couple years, so I doubt this will fully solve the problem. Once I’m able to build again I’ll try to get some more helpful sample projects to you.

1 Like


can you retest this with 20201119-162149-elements-develop (or later)? while my colleague was not able to reproduce your issue exactly, she fixed some things that could have caused it.


1 Like

Glad to hear! I’m traveling today but will test it out when I get a chance.

1 Like


is this still relevant/happening for you?

I’ve moved to a Mac in January, and the debugger is much more reliable than on Windows. I do still have issues where it will hang at startup, but I can pretty reliably cancel a debug session and re-launch and get it to connect without issue after a couple attempts at most.

Is that in Fire, or when yu do go back to Water? In any case, id say this sounds like we still need to look into thats going on, even if it’s not as bad a problem as it used to be…

That’s on Fire. There are a few issues I get:

  1. The debugger will fail to connect altogether. This seems to be an issue with Fire’s adb interaction. It will fail immediately with an error (I think about the JVM terminating early iirc). But then if I re-run the debug session it connects without issue.

  2. The debugger seems to hang at times during execution. Usually when this happens, the thread stack in the left pane will clear completely as if it’s between execution points, but then it just never responds (I’ve left it for hours before to test and it remains hung). Usually if I kill the session and re-launch a new one it will work (on Fire).

  3. The debugger hangs at startup fairly often. This was the issue I reported on Water. On Water this was probably 9/10 times for me. On Fire it’s more like 1/10 times for me so it’s a lot less significant. I only get this issue in my primary app (can’t repro in a test case) and my app has a lot of startup code, so this could be the same issue as #2 but just more noticeable. But it does seem that if it gets past startup it’s a lot less likely to fail, so this may be a different issue.

Anything in the build or debug log? all the adb calls and their output should be logged.

sounds like that’s the same issue, yeah, just for some reason it was more prominent in Water or on Windows. I suggest I get @elenap to debug this locally on your WIndows machine in Water, if that’s still available (as debugging the managed stuff in Fire is a lot trickier)…

Hello Matt,

The debugger hangs at startup fairly often.

Does it mean that debugger is fully unresponsive and the application is not deployed on device? Or you could see application on device/simulator loaded completely and actionable? Are your breakpoints resolved or not? What happens if you do Pause, then Continue - does it show stack frames after Pause? If it allows to do Stop debugging or you need to shut down Water/Fire?

The debugger seems to hang at times during execution. Usually when this happens, the thread stack in the left pane will clear completely as if it’s between execution points, but then it just never responds (I’ve left it for hours before to test and it remains hung).

Am I understand right that after some amount of StepOver/StepInto/StepOut actions it just doesn’t do the next one? What if you do Pause/Continue when it hangs? What happens with application on device?