Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot see coroutine tab in the debugger tool window

I am trying to debug coroutines and followed the below resources to enable in Android Studio,

  • Jetbrain bug issue
  • Jetbrain blog
  • Jetbrain doc

but unfortunately, I don't see the coroutine tab at all!! (below screenshot)

Coroutine library version,

implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.2"

and my Kotlin plugin version is 1.4.21

Why do I still not see the coroutine debug tab?

enter image description here

like image 313
Binary Baba Avatar asked Dec 08 '20 06:12

Binary Baba


People also ask

How do I add coroutines to IntelliJ?

In the Project Structure dialog, go to Project Settings | Libraries, press "+" button and select "From Maven..." in the popup. In the dialog that appears, enter the name and version of the library you need, which you can find out in the documentation. (For the current version of the core library of kotlinx.

How do I launch coroutine?

launch. The simplest way to create a coroutine is by calling the launch builder on a specified scope. It Launches a new coroutine without blocking the current thread and returns a reference to the coroutine as a Job. The coroutine is canceled when the resulting job is canceled.

How do I add coroutines to Kotlin project?

Step 1. Go to Tools → Kotlin → Configure Kotlin Plugin Updates, select “Stable” in the Update channel drop-down list, and then click Check for updates. We are adding coroutines-core along with coroutines-android. Now, sync your project with gradle files and you are ready use the latest Coroutines.

How do I debug a coroutine in Visual Studio Code?

Run the code in debug mode by clicking Debug next to the run configuration at the top of the screen. The Frames tab contains the call stack. The Variables tab contains variables in the current context. The Coroutines tab contains information on running or suspended coroutines. It shows that there are three coroutines.

What does the coroutines tab contain information on?

The Coroutines tab contains information on running or suspended coroutines. It shows that there are three coroutines. The first one has the RUNNING status, and the other two have the CREATED status. Resume the debugger session by clicking Resume Program in the Debug tool window:

How do I rearrange the tabs in the debug tool?

Click in the top-right corner of the Debug tool window, then click Restore Default Layout. You can arrange the tabs to fit your preference. You can move a tab to another location or group a tab with another tab, so that they share the same space on the screen. Drag the tab header to the desired location.

How to debug a coroutine in IntelliJ IDEA?

The first coroutine has the SUSPENDED status – it is waiting for the values so it can multiply them. The second coroutine has computed its value and disappeared. The third coroutine is calculating the value of b – it has the RUNNING status. Using IntelliJ IDEA debugger, you can dig deeper into each coroutine to debug your code.


1 Answers

As far as I know coroutine debugger is not yet available on android at all. This question was brought up during the kotlin event in October and here is the answer from the kotlin devs.

Update: coroutines debugger for android has been finally announced on Google IO 2021!

like image 126
esentsov Avatar answered Oct 07 '22 19:10

esentsov