简体   繁体   English

Android Studio 1.2 beta版在调试时挂起

[英]Android Studio 1.2 beta version hangs on debugging

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. 我刚刚将Android Studio从1.0版升级到1.2测试版,我无法再执行任何类型的调试操作。 If I set a break point, Android Studio hangs and it can't resolve the command: 如果我设置了一个断点,Android Studio会挂起并且无法解析该命令:

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? 那么,是否可以降级到之前的稳定版本(1.0)而无需再次下载?

Thanks! 谢谢!

First Solution 第一解决方案

1-Click file menu 1-Click文件菜单

2-Click Invalidate Caches / Restart 2单击“使高速缓存无效/重新启动”

3-Click Invalidate And Restart 3单击“无效并重新启动”

note : work in the same session only. 注意:仅在同一会话中工作。

Second Solution 二解决方案

-Use GenyMotion Emulator With Android Version 5 or up. - 使用Android版本5或更高版本的GenyMotion模拟器。

Third Solution 第三解决方案

-Use Android Studio 1.1 in my job my teammate use this version and it's okay . - 在我的工作中使用Android Studio 1.1我的队友使用这个版本,没关系。

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 下载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. 更新:我尝试过Android Studio 1.3 Preview,但仍然遇到同样的问题。

Update: here in android studio info problem fixed link 1 link 2 更新:里安卓工作室信息 问题固定 链接1 链接2

It looks like a bug in Android studio. 它看起来像Android工作室中的一个错误。 It's reported here: https://code.google.com/p/android/issues/detail?id=73828 这里有报道: https//code.google.com/p/android/issues/detail?id = 73828

Here is an answer from Google regarding problems with current versions of Android Studio running with pre M version phones - 以下是谷歌关于使用预M版手机运行的当前Android Studio版本问题的答案 -

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..". 该问题以两种方式之一显示:Studio将响应,但调试器将停留在“收集数据...”或“等待最后一个调试器命令完成...”。 This happens on both Dalivk and ART, so all versions of the platform are affected. Dalivk和ART都会发生这种情况,因此平台的所有版本都会受到影响。 The issue is more prevalent with Studio 1.2, but exists on all versions of Studio. 这个问题在Studio 1.2中更为普遍,但在所有版本的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/ ) M预览的下一个版本很可能有这个修复(在这里进行CL: 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. 有关如何执行此操作的详细信息,请参阅注释#82。 The next release of Studio 1.2 and Studio 1.3 will be make this the default. Studio 1.2和Studio 1.3的下一个版本将使其成为默认版本。 ( https://android-review.googlesource.com/#/c/152715/ ) 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) 您可以在调试器中关闭调用方法的各种设置:这些设置包括:a)内联调试( https://www.jetbrains.com/idea/help/inline-debugging.html)b )“启用'toString()'对象视图“(设置|调试器|数据视图| Java)c)”为集合类启用备用视图“(设置|调试器|数据视图| 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. 但是,如果在将暂停策略更改为仅线程后仍然看到问题,那么不幸的是,您还必须执行2中的步骤。

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. 感谢大家的耐心和帮助,为我们提供了repro案例和堆栈跟踪。

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

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 我在Mac上运行所以我所要做的就是从/ Applications中删除Android Studio.app并重新安装Android Studio,尽管我重新安装了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.1.0更改为1.2,因此可以实现上述目的。

Try to restart the Android Studio and the emulator if you're using one. 如果您正在使用,请尝试重新启动Android Studio和模拟器​​。 This works for me 这适合我

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. 这不是一个理想的答案,因为你的问题是关于降级,但如果你不是太忙于重启你的电脑可能每天两次,你可能想要挂到1.2,直到他们修复它。

Latest Android Studio changelog says it is fixed in version 1.3 Preview 3. 最新的Android Studio更新日志表示它已在1.3版预览版3中修复。

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

Hooray! 万岁!

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. 我遇到了相同的行为(调试中的Android Studio阻止),并发现使用安装了Android 5.1的Nexus 7时似乎没有出现这种情况。 It does reproducibly occur on a SAMSUNG SM-T110 with Android 4.2.2. 它确实可以在Android 4.2.2的SAMSUNG SM-T110上重现。 I habe never tested with an emulator however. 但我从来没有测试过模拟器。 This could mean, that the target device might be responsible for the hang. 这可能意味着目标设备可能负责挂起。

只需拔掉USB连接设备就可以了!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM