Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
936 views
in Technique[技术] by (71.8m points)

visual studio - Unable to run Android Emulator

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...