50

I’ve just upgraded Android Studio from version 1.0 to 1.2 beta and I can no longer perform any kind of debug operation. If I set a break point, Android Studio hangs and it can’t resolve the command:

Waiting until last debugger command completes

but it never completes.

So, is it possible to downgrade to the previous stable version (1.0) without downloading again?

Thanks!

Armali
  • 18,255
  • 14
  • 57
  • 171
Víctor Albertos
  • 8,093
  • 5
  • 43
  • 71
  • 4
    Even in the stable channel seems to have this issue. – clauziere May 08 '15 at 19:53
  • 3
    Indeed. I had the same problem with the "stable" version and the only solution was to uninstall Android Studio (without the sdk) and reinstall it again using an old installation for version 1.1 and specifying the path of the sdk which is usually in "Users\~\AppData\Local\Android\sdk" for windows. It is only ~420MB so it was quite faster then I thought. I guess the problem is from the new debugger tool in Intellij IDEA 14. – Nikolay Hristov May 10 '15 at 08:44
  • Restarting AS (1.2.1.1) always works for me to remedy this. – Hong May 29 '15 at 22:07
  • As workaround, I've downgraded my Android Studio to 1.1.0, download it from official web site here http://tools.android.com/download/studio/canary/1-1-0 and debugger works fine now. WTF Google? Why so many critical bugs in 1.2 !! – Roman May 30 '15 at 15:30
  • For the sake of completeness - here is the (or one of the) original bug reports: https://code.google.com/p/android/issues/detail?id=172523 - it was marked as fixed for Android Studio version 1.3 – AgentKnopf Aug 05 '15 at 09:05
  • This happens to me on IntelliJ Ultimate 14.1.4 while debugger regular Java 8 code (nothing to do with Android). – Steve Aug 19 '15 at 00:11

9 Answers9

15

First Solution

1-Click file menu

2-Click Invalidate Caches / Restart

3-Click Invalidate And Restart

note : work in the same session only.

Second Solution

-Use GenyMotion Emulator With Android Version 5 or up.

Third Solution

-Use Android Studio 1.1 in my job my teammate use this version and it's okay .

the new debugger add variable value beside it in debugging steps it may cause the problem .

imagine that you watch all variables in debugging it should make problem. it's called Inline Debugger

download link to Android Studio 1.1 : http://tools.android.com/download/studio/canary/1-1-0

Third Solution is my own choice at work.

Update: I tried Android Studio 1.3 Preview but still have the same problem.

Update: here in android studio info problem fixed link 1 link 2

amorenew
  • 10,760
  • 10
  • 47
  • 69
6

It looks like a bug in Android studio. It's reported here: https://code.google.com/p/android/issues/detail?id=73828

Peter Knut
  • 2,311
  • 20
  • 15
4

Here is an answer from Google regarding problems with current versions of Android Studio running with pre M version phones -

For anyone else who might encounter this issue, here is a summary:

The issue shows up in one of two ways: Studio will be responsive, but the debugger will be stuck at either "Collecting Data.." or "Waiting for last debugger command to complete..". This happens on both Dalivk and ART, so all versions of the platform are affected. The issue is more prevalent with Studio 1.2, but exists on all versions of Studio.

The correct fix for this issue is in the platform. The next version of M preview is likely to have this fix (in progress CL here: https://android-review.googlesource.com/#/c/152715/)

Until then we have some workarounds which reduce the probability of hitting this issue. So if you encounter this issue, you can try one of the following:

  1. Change your breakpoint to only suspend the thread where it is hit rather than all threads. See comment #82 for more info on how to do this. The next release of Studio 1.2 and Studio 1.3 will be make this the default. (https://android-review.googlesource.com/#/c/152715/)

  2. You can turn off various settings in the debugger that invoke methods: These include: a) inline debugging (https://www.jetbrains.com/idea/help/inline-debugging.html) b) "Enable 'toString()' object view" (Settings | Debugger | Data Views | Java) c) "Enable alternative view for Collections classes" (Settings | Debugger | Data Views | Java)

The 2nd option is more severe (it limits the amount of automation the debugger does for you), so we are not enabling that by default. However, if you still see the issue after changing the suspend policy to thread only, then unfortunately, you'll have to do the steps in 2 as well.

Finally, if you still see the issue after both, then that would be a new bug. Please file a new bug with a test case.

Thanks everyone for your patience and your help in providing us with repro cases and stack traces.

https://code.google.com/p/android/issues/detail?id=172523

Graeme
  • 25,714
  • 24
  • 124
  • 186
1

This happened to me too.

I am running on a Mac so all I had to do was remove the Android Studio.app from /Applications and reinstall Android Studio although I reinstalled version 1.1.0

I understand that the settings folder name changed from version 1.1.0 to 1.2 so that made the above possible.

1

Try to restart the Android Studio and the emulator if you're using one. This works for me

gentra
  • 6,066
  • 3
  • 16
  • 18
  • 2
    Actually I doubt it's the problem with the emulator. I'm using a real device and 1.2 beta also hangs on debugging. Compiling from gradle console works fine (clean, assembleDebug etc.). Ubuntu 14.04 LTS x64, Java JDK 1.8, #AI-141.1825374, April 1 2015. It worked with previous versions. – kosiara - Bartosz Kosarzycki Apr 13 '15 at 09:19
1

I'm still experiencing this problem, after the final release version. I found that restarting my PC solved it (for half of the day). This is not an ideal answer, as you're question is about downgrading, but if you're not too bothered at restarting your PC maybe twice a day, you might want to hang onto 1.2 till they fix it.

amateurjustin
  • 146
  • 1
  • 10
1

Latest Android Studio changelog says it is fixed in version 1.3 Preview 3.

http://tools.android.com/recent/androidstudio13preview3nowavailable

Hooray!

vfede
  • 106
  • 1
  • 6
0

I have experienced the very same behaviour (Android Studio blocking in debug) and discovered that it does not seem to occur when using Nexus 7 with Android 5.1 installed. It does reproducibly occur on a SAMSUNG SM-T110 with Android 4.2.2. I habe never tested with an emulator however. This could mean, that the target device might be responsible for the hang.

-1

Just unplug your USB connected device does the trick for me!

Jiyeh
  • 5,187
  • 2
  • 30
  • 31