-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Make debug module Android-compatible #948
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
So how are we supposed to debug deadlocks on Android? |
You can write unit / integration tests and debug your logic with them. |
So I need to write (AND keep) two copies of my logic just to debug deadlocks? |
We don't have a good answer yet. |
Any reasons we need to use |
On JVM we can inject debugger into running code. This is done via |
Can't kotlin-stdlib have hooks or something to make this compatible? |
kotlin-stdlib has special debug hook, but it is static -- to use this hook you must rewire a specifically designed class inside kotlin-stdlib. You don't even need AOP framework for that. You can simply replace the corresponding class. On JVM we can do it at run-time. On Android it has to be a part of dexing toolchain. The trick is that we need to maintain Gradle plugin that does this reliably and is tested and integrated with Android toolchain. And that is quite painful. |
What I was thinking is that maybe we can update kotlin-stdlib and relax the restrictions on the debug hook so that we can do this without using |
The is no way to make it work in a reliable and modular way -- we cannot use |
For performance issues, can we do something like build variants that disables the dynamic hook for release builds? |
That is exactly why we need Gradle plugin on Android. We need it to hook a special "debug-enabled" (appropriately patched) version of |
Is this planned anytime soon? |
It is also mentioned that it will be possible when AGP 3.3 will be supported (they actually stated it support up to
So what is the current status on this? |
We decided not to implement this request ourselves. |
Do you guys think that instead of AspectJ you could use Byte Buddy on Android with https://github.com/LikeTheSalad/android-buddy instead? |
Here's a permalink to the target doc: https://github.com/Kotlin/kotlinx.coroutines/blob/8f1c728bade0416037793900355de31e064a1dae/core/kotlinx-coroutines-debug/README.mdUPDATE: Note that the most recent version of documentation mentions Android incompatibility. See: https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-debug/README.md#debug-agent-and-android
Leaving this issue open as a change request for future support of Android on-device debugging.
The text was updated successfully, but these errors were encountered: