Debugging Android in Water (.2369)

If I debug my Android project in Water, then debug a different app in Android Studio, then return to debug my project in Water, the debug session fails in Water.

Things I’ve tried that haven’t worked:

  • Restarting Water
  • Running adb kill-server and adb start-server
  • Killing Android Studio
  • Restarting my laptop

The only thing I found that does work is re-installing Water.

There is no information in the Water.log file. The Build Log in Water shows a normal successful build but then “Last debug session failed.”

This seems to be new as of .2369 – at least I had not noticed it before, and I believe I was able to do this even on .2365 without issue.

Can’t believe that that can make any difference. Reinstalling literally does nothing but copt the same files in place, again. There must be something else going n

Hmm, odd, as nothing here has changed in forever.

Can I ask you to attach a second copy of Water to Water (Echoes/.NET Debugger, 4.x Runtime), make sure Break on Exceptions is on, and see if there’s any exception inside Water that gives us more infos?

FWIW, I think there are known issues with debugging Android apps when Android Studio is running, as it hooks into some APIs that prevent anyone else from successfully interactive with them (I forgot the details). but stopping ADS should do the trick, if that were the issue here.

thanx!

Yes I’ve experienced these before, but as you said, stopping ADS would fix it.

Happy to help, but I’m not following. What do you mean by attach a second copy of Water to Water?

Start a second copy of Water. Go to Debug|Attach to Process. Select Platform = Echoes/CLR, Runtime = v4 at the top, then find the first copy of Water in the list and select it. Click “Attach”. Make sure “Stop on Exceptions” is turned on in that second copy of Water. (Also, just to be sure go to Debug|Manage Ignored Exceptions and click “Uncheck All”).

Now switch back to the first copy of Water and do whatever needs doing to make it fail.

Hopefully, the second copy of Water will catch the exception, and pause to show you details. Send those to me. (ideally the exception message, and a stack trace. (you can get a full stack trace with typing “bt” in the debug console.

thanx,
marc

1 Like

This is strange, but when I “Attach to Process” to the original Water, the original Water process is killed immediately. The only output to Water.log is this:

2019-02-05 15:25:27 parameters {
“AttachToPID”: 14404,
“Mode”: “Echoes”,
“SubMode”: “.NET”,
“Architecture”: “x86_64”,
“CrossBox”: “Local”,
“NETFrameworkVersion”: “v4”
}

hmm, odd.

I’ll see if someone can reproduce your original issue locally. If not, maybe I can TeamView into your system sometime later today or tomorrow?

1 Like

Sounds good, thanks.

1 Like

Matt,

I’m told we cannot repro this locally, so I’d appreciate if I could debug/inspect what’s going on your machine, at your convenience, via team Viewer. I’ll be around for another 1-2 hours today, and be in around 7-8am Atlantic Time, tomorrow.

Do you have a copy of Visual Studio 2015 or 2017 installed? If so, that’d help me with debugging, since you said the attaching from Water did not work (though I’d like to re-test that part, as well).

thanx,
marc

Marc, I missed the notification for your reply. Thanks for checking and for offering to Team View. At the moment I have a few critical bugs to fix, and I’m able to avoid this problem until I fix them, so I’d probably better wait. I’ll direct message you to see if/when you’re available to team view in the future if this is still an issue. Thanks again - I greatly appreciate your willingness to help with edge case stuff like this!

1 Like

Thanx!

For the sake of updating the thread, the issue may only be indirectly related to Android Studio (or possibly not at all, though there seemed to be a strong correlation). I’ve been debugging all morning and have now hit the same “Debug session failed” wall, but I have not launched Android Studio today.

odd, but probably good.

I’d be cool to attach and see the error. if you’re free, I could TV in now to se if I can gather more info, if it persists consistently…

1 Like

I’m not getting the bug at the moment. It does seem to be unrelated to Android Studio, since I just debugged an app on there and it did not cause an issue. I’m on .2365 at the moment. I’ll try upgrading to .2369 again to see if the bug reappears.

1 Like

I assume there’s no relevant output in either the Build log or the Debug log, when the launch fails, right?

Nope

Again, for the sake of tracking the issue as I notice it… It seems like it is not an Android Studio interaction problem but an ADB interaction problem. A few times a week I suddenly get the “debug failed” message in Water. Restarting Water, re-connecting my device, and adb kill-server / adb start-server do not fix it. What does fix the problem 100% of the time (so far at least) is launching Android Studio, doing an on-device run from AS, then closing AS and running again from Water.

It seems like possibly a state problem with ADB that Android Studio is fixing for me but Water is not. Again, nothing in the logs, I’m just mentioning symptoms as I see them in case it’s helpful in the future.

I may have stumbled upon the solution to this. When I get the failed debug, adb kill-server ... adb start-server does not fix the problem. What does fix it is adb reconnect. Perhaps Android Studio includes adb reconnect in its ADB initialization but Water does not?