10

I use Android Studio Chipmunk | 2021.2.1 Patch 2. My OS is 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. Emulator doesn't come online. It doesn't work. I have searched and almost tried every solution on stackoverflow. Still getting the same error.

Gradle Settings

Gradle User Home: C:\Users\UserName\.gradle

Use Gradle From: 'gradle-wrapper.properties' file

Gradle JDK: Android Studio Default JDK version 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)

What should I do?

Thank you for responses.

ilyas
  • 103
  • 1
  • 1
  • 5

10 Answers10

2

Consider selecting Api level 27 or below, which resolved the same error for me in creating an emulator using Api level 30 or above.

ErikE
  • 48,881
  • 23
  • 151
  • 196
shams7
  • 71
  • 1
  • 3
1

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-...: Task manager - Details
  3. Copied command from Command line column
  4. Pasted in command prompt
  5. Forced task qemu-... end
  6. Delete any .lock file that you find in the virtual device folder
  7. Launched command
  8. Finally saw some actual errors appear

My issue was due to some missing dlls

0

Install newest update to android emulator 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 . Attach a debugger or EC to cancel

Second, delete all android virtual devices and install them again.

It's a bug and probably will eventually be solved by Google.

ErikE
  • 48,881
  • 23
  • 151
  • 196
0

maybe you have 2 different versions of 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).
then run the emulator again and see if it works or not.

Farrokh
  • 1,167
  • 1
  • 7
  • 18
0

Same problem but my emulator is working fine. Use Android 9.0 and Pixel 3 API 28. The dialog box "attach a debugger or esc to cancel" occurs but the emulator works, you need to cancel this dialog box.

--->> use android 9.0 and pixel 3 api 28 emulator

Danilo Fuchs
  • 911
  • 8
  • 17
0

Just press the escape key. It solves the problem. I also suffered for 3 months because of this. But now, the baby is working.

0

It no longer asks me the "Attach debugger or Esc to cancel" window after upgrading to the following.

  1. AS: Android Studio Dolphin | 2021.3.1 Patch 1
  2. Emulator Version: 31.3.14

I have also Unchecked the following checkboxes in 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"

I hope this helps.

MG Developer
  • 859
  • 11
  • 17
0

From issue tracker: https://issuetracker.google.com/issues/243054171?pli=1

Solution in comment 16 worked like a charm:

ri...@zimperium.comri...@zimperium.com #16Nov 8, 2022 01:44PM Looks like the problem is Google has compiled swiftshader with -DEBUGGER_WAIT_DIALOG. According to sources of swiftshader, a way to disable this dialog is to set environment variable SWIFTSHADER_DISABLE_DEBUGGER_WAIT_DIALOG to 1. An alternative workaround would be to change -gpu mode away from swiftshader.

Wayne Werner
  • 1,120
  • 9
  • 7
0

Go to SDK Manager, then go to SDK Platforms > Select appropriate API level(Which you have selected for Emulator) > Press OK. Restart Emulator , then after emulator boot up ; run your code. Hope it would help you !

-1

I just closed error message and emulator opened fine. Nexus 6 API 22.

shevalye
  • 1
  • 1
  • 2
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 02 '23 at 20:34