Closed mpivchev closed 2 years ago
"used to not be possible to debug suspend functions but apparently this has been resolved now" JVM or native? The error message is blocking your code. Is the breakpoint in the body or where it's being called?
Native.
The function is the getBreedsFromNetwork
function from your example. Nothing has been changed. I just tested it because our project's Native Kotlin code also can't be debugged.
I think we will re-evaluate this once kotlin 1.4 is ready and see if there is still an issue then
I'm also trying out the debugger and it's not working on suspend functions and flow. That's a shame.
This is pretty old, but I think we can look and close now that we're on 1.6.10.
The debugging isn't a "KaMPKit" thing as much as a Kotlin compiler and tooling thing. I would try this in the Xcode plugin, and make sure the breakpoint is on "code" and not on a bracket, etc.
We are revisiting the Xcode plugin now, so probably some "tips and things to avoid" wouldn't be bad.
Added https://github.com/touchlab/xcode-kotlin/issues/48 for follow up later.
This seems to be largely working for me.
I can successfully stop at breakpoints inside suspend functions on Android Studio 2021.1.1 with KMM Plugin 0.3.1, and inside Xcode with the lastest version of the plugin. The one weirdness I encountered was that, in unit tests, I wasn't able to debug a line with a lambda (eg log.d { "Fetching Breeds from network" }
) in Android studio. But it works when the app is live.
Whenever I try to debug a suspend function I get the following error:
From what I've read online it used to not be possible to debug suspend functions but apparently this has been resolved now. Is it still impossible for MPP?