简体   繁体   English

如何修复“附加调试器或 ESC 以取消”错误?

[英]How can I fix "Attach a Debugger or ESC to Cancel" error?

I use Android Studio Chipmunk |我使用 Android Studio Chipmunk | 2021.2.1 Patch 2. My OS is win 8.1 Pro. 2021.2.1 补丁2,我的操作系统是win 8.1 Pro。 Emulator is Pixel XL API 25. I have JDK-18.0.2 Even there is not any connected phone to my computer I get "Attach a Debugger or ESC to Cancel" error.模拟器是 Pixel XL API 25. 我有 JDK-18.0.2 即使没有任何手机连接到我的电脑,我也会收到“附加调试器或 ESC 以取消”错误。 Emulator doesn't come online.模拟器没有上线。 It doesn't work.它不起作用。 I have searched and almost tried every solution on stackoverflow.我已经搜索并几乎尝试了 stackoverflow 上的所有解决方案。 Still getting the same error.仍然出现相同的错误。

Gradle Settings Gradle 设置

Gradle User Home: C:\Users\UserName\.gradle Gradle 用户主页:C:\Users\UserName\.gradle

Use Gradle From: 'gradle-wrapper.properties' file使用 Gradle 来自:'gradle-wrapper.properties' 文件

Gradle JDK: Android Studio Default JDK version 11.0.12 Gradle JDK: Android Studio 默认 JDK 版本 11.0.12

JAVA_HOME: C:\Program Files\Java\jdk-17.0.2\bin (also tried C:\Program Files\Java\jdk-18.0.2\bin) JAVA_HOME: C:\Program Files\Java\jdk-17.0.2\bin(也试过C:\Program Files\Java\jdk-18.0.2\bin)

What should I do?我应该怎么办?

Thank you for responses.感谢您的回复。

There might be some underlying error you're not seeing.可能存在一些您没有看到的潜在错误。 I had the same problem and did this:我遇到了同样的问题并这样做了:

  1. Launched emulator as usual像往常一样启动模拟器
  2. When Attach a Debugger or ESC to Cancel appears, I went on Task manager - Details tab to see the command line that was used for the process qemu-... :Attach a Debugger or ESC to Cancel出现时,我进入任务管理器-详细信息选项卡以查看用于进程qemu-...的命令行: 任务管理器 - 详细信息
  3. Copied command from Command line column从命令行列复制命令
  4. Pasted in command prompt粘贴在命令提示符中
  5. Forced task qemu-... end强制任务qemu-...结束
  6. Delete any .lock file that you find in the virtual device folder删除您在虚拟设备文件夹中找到的所有.lock文件
  7. Launched command启动命令
  8. Finally saw some actual errors appear终于看到了一些实际的错误出现

My issue was due to some missing dlls我的问题是由于缺少一些 dll

Install newest update to android emulator 31.3.10.安装 android 仿真器 31.3.10 的最新更新。 Then restart computer and after showing window with "Attach a Debugger or ESC to Cancel" press ESC button... Android emulator will start.然后重新启动计算机,在显示 window 和“附加调试器或 ESC 以取消”后按 ESC 按钮... Android 模拟器将启动。

enter image description here在此处输入图像描述

Second第二

Delete all android virtual devices and install them again删除所有 android 虚拟设备并重新安装

It's only a bug, probably will be solved by Google这只是一个错误,可能会被谷歌解决

maybe you have 2 different versions of adb.exe也许你有 2 个不同版本的 adb.exe
if you are a windows user, open task manager and find adb.exe in the process list, right-click on it and choose Open File Location, remove that folder or move it to a temporary place,(make sure you killed adb.exe using task manager before moving it).如果您是 windows 用户,请打开任务管理器并在进程列表中找到 adb.exe,右键单击它并选择打开文件位置,删除该文件夹或将其移动到临时位置,(确保您杀死了 adb.exe在移动之前使用任务管理器)。
then run the emulator again and see if it works or not.然后再次运行模拟器,看看它是否有效。

I was also getting the same error when I was selecting Api level 30 or above.当我选择 Api 30 级或更高级别时,我也遇到了同样的错误。 After selecting Api level 27 or below its working fine.选择 Api 级别 27 或低于其工作正常后。

same problem but my emulator is working fine use android 9.0 and pivel 3 api 28 the dailog box "attach a debugger or esc to cancel " occur but emulator work you need to cancel this dailog box --->> use android 9.0 and pixel 3 api 28 emulator same problem but my emulator is working fine use android 9.0 and pivel 3 api 28 the dailog box "attach a debugger or esc to cancel " occur but emulator work you need to cancel this dailog box --->> use android 9.0 and pixel 3 api 28位仿真器

Just press the escape key.只需按退出键。 It solves the problem.它解决了这个问题。 I also suffered for 3 months because of this.我也因此痛苦了3个月。 But now, the baby is working.但是现在,宝宝正在工作。

It no longer asks me the "Attach debugger or Esc to cancel" window after upgrading to the following.升级到以下版本后,它不再询问我“附加调试器或 Esc 以取消”window。

  1. AS: Android Studio Dolphin | AS: Android 海豚工作室 | 2021.3.1 Patch 1 2021.3.1 补丁 1
  2. Emulator Version: 31.3.14模拟器版本:31.3.14

I have also Unchecked the following checkboxes in Android Studio我还在 Android Studio 中取消选中以下复选框

  1. "System > Settings/Preferences > Tools > Emulator > Launch in tool Window" “系统 > 设置/首选项 > 工具 > 仿真器 > 在工具窗口中启动”
  2. "System > Settings/Preferences > Build Execution Deployment > Debugger > Hotswap > Enable hotswap agent for Groovy code" “系统 > 设置/首选项 > 构建执行部署 > 调试器 > 热交换 > 为 Groovy 代码启用热交换代理”

I hope this helps.我希望这有帮助。

From issue tracker: https://issuetracker.google.com/issues/243054171?pli=1来自问题跟踪器: https://issuetracker.google.com/issues/243054171?pli=1

Solution in comment 16 worked like a charm:评论 16 中的解决方案非常有效:

ri...@zimperium.comri...@zimperium.com #16Nov 8, 2022 01:44PM Looks like the problem is Google has compiled swiftshader with -DEBUGGER_WAIT_DIALOG. ri...@zimperium.comri...@zimperium.com #16Nov 8, 2022 01:44PM 看起来问题是谷歌用 -DEBUGGER_WAIT_DIALOG 编译了 swiftshader。 According to sources of swiftshader, a way to disable this dialog is to set environment variable SWIFTSHADER_DISABLE_DEBUGGER_WAIT_DIALOG to 1 .根据 swiftshader 的来源,禁用此对话框的一种方法是将环境变量SWIFTSHADER_DISABLE_DEBUGGER_WAIT_DIALOG设置为1 An alternative workaround would be to change -gpu mode away from swiftshader.另一种解决方法是将 -gpu 模式从 swiftshader 中移除。

Go to SDK Manager, then go to SDK Platforms > Select appropriate API level(Which you have selected for Emulator) > Press OK. Go 到 SDK Manager,然后 go 到 SDK Platforms > Select 适当的 API 级别(您为模拟器选择的级别)> 按 OK。 Restart Emulator, then after emulator boot up;重启模拟器,然后在模拟器启动后; run your code.运行你的代码。 Hope it would help you !希望对您有所帮助!

I just closed error message and emulator opened fine.我刚刚关闭了错误消息,模拟器打开得很好。 Nexus 6 API 22.联系 6 API 22。

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

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