简体   繁体   中英

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

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.

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!

新的代理配置

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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