Unable to run Android Emulator

2019-01-25 11:39发布

I have a Xamarin.Forms project in Visual Studio 2013 and when I try to run my Android application the emulator loads but then it doesn't load the app and different errors will occur.

When I try to run the Android Emulator depending on what settings I chosen it either pops up with

DWP handshake failed

or in the debug output it shows

Couldn't connect to logcat, GetProcessId returned: 0

All existing solutions I have found haven't worked so far, even though they have worked in the past.

6条回答
爷的心禁止访问
2楼-- · 2019-01-25 11:59

I just wanted to list here all the things I have done to resolve this issue since it has happened to me a few times, with different reasons each time.

Release then Debug

Sometimes you need to run it in Release mode first to the emulator, then you can switch back to Debug mode and it works.

Fast Deployment

  1. Go to the properties in your Android Project

  2. Go to Android Options

  3. Turn off Fast Deployment

If that doesn't work, you can also try

  1. Turning off Shared Runtime

  2. Settings the Linker to Don't Link

Check your logs

Open up the Android Device Logging, connect to your emulator and see what messages are coming back.

enter image description here

For me I saw an Out of Memory Exception. The emulator only had 323 MB of memory set for it. Open the emulator manager (the icon next to the device logging) and then edit your emulator. Increase the memory to 512 MB (that did it for me), and it all started working again.

If this doesn't resolve your error, more scenarios are updated at Debugging Xamarin Android Build and Deployment Errors.

查看更多
够拽才男人
3楼-- · 2019-01-25 12:16

deselect 'Use Shared Runtime' in Project Properties > Android Options > Packaging properties

查看更多
相关推荐>>
4楼-- · 2019-01-25 12:19

Right click on your App(Solution name)

Go to Properties => Open android option => at last you see Debugger

in dropdown you select microsoft its work for me after all of solution check

查看更多
爱情/是我丢掉的垃圾
5楼-- · 2019-01-25 12:20

This has been resolved but it didn't work for me.

If you are looking for an alternative solution: I had to change the platform CPU from Any CPU to x86 for it to work on my pshycial device (Galaxy S6 edge +)

查看更多
Ridiculous、
6楼-- · 2019-01-25 12:22

Use an android x86-based emulator not an ARM-based emulator. You can inherit from any of the default ones that ship with the Android SDK using the AVD Manager (preferably from inside Xamarin) and create your own targeting some Android API Level. Also ensure you have the latest Intel HAXM build installed and running; this is important for accelerating the performance of x86-based emulators.

查看更多
The star\"
7楼-- · 2019-01-25 12:23

Restarting VS works for me. I'm using VS2015 community, Win10 Home 64, Android Player 64.

查看更多
登录 后发表回答