Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Xamarin: Could not connect to the debugger

I'm working with Visual Studio Community 2015 Update 3 and the Visual Studio Emulator for Android (API Level 19). Everything works fine, but since last Xamarin update I can't deploy to Visual Studio Emulator.

I click on run at visual studio and it deploys the app to the emulator (I cann see it in app drawer), then it starts the app. But the app closes immediately, and visual studio says at output:

Could not connect to the debugger.

Solutions I tried already (without success):

  • Enabled Migrate to a physical computer with a different processor version in Hyper-V settings
  • Disabled Use Fast Deployment in project settings

EDIT: On my real phone I can debug this app.

EDIT2: Here's the logcat output

like image 647
Marcel Avatar asked Oct 28 '25 10:10

Marcel


2 Answers

I had the same problem and it's really frustrating! I had the problem for both Visual Studio 2019 and Visual Studio 2022.

I tried literally every solution on the web, and none of these worked for me:

  • updating everything in Visual Studio to the latest version
  • updating every Android SDK and component
  • sending various adb commands via the ADB console (like: adb -s 10.0.2.2:5554 root)
  • @TienQuang solution in this post
  • restarting multiple times Visual Studio and Windows
  • deleting and recreating Android emulators images

I was really out of solutions to try, and then...I simply reset my emulator proxy configuration (the always worked fine) switching to the "default Android Studio HTTP proxy settings", and now I can debug my application!

New proxy configuration

like image 117
MAXE Avatar answered Oct 29 '25 23:10

MAXE


I've had this problem before. My problem was that the emulator was old and could not load things properly and was really slow. I suggest upgrading to a different emulator or just using your phone for debugging. If you want, you could try running it in release and see if it runs then. If not create a new emulator from the AVD Manager.

like image 41
JJohnson Avatar answered Oct 30 '25 01:10

JJohnson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!