AVD Crash on second monitor

2019-04-07 14:31发布

问题:

I just installed Android Studio and was trying to get a preview of my application but whenever i start the AVD Emulator on whatever devices or API it crashes, but it only do crash when I swipe the window of the AVD to my second monitor.

my computer configuration : i7-6700k, 16Gb RAM and a GTX 1060
the AVD configuration :

Anyone had the same problem in the past or have a solution ? feel free to ask me for more info in case I didn't explained enough

回答1:

I had the same problem, and I found a solution that you can have the hardware acceleration still activated and move the AVD between monitors.

Here's how I did it:

  1. Start the AVD.
  2. Go to Extended Controls (the last button on the control strip, with the 3 dots) > Settings > Advanced
  3. Change the "OpenGL ES renderer" to "ANGLE (D3D11)"
  4. Restart the AVD.

And there you go.



回答2:

The problem appears also with a i7-6700k, GTX 1080 and miscellaneous AVDs in my environment. It works without a problem when Nvidia Surround is enabled. But this might not be a solution which everyone prefers.



回答3:

I had this same problem and solved it by setting the AVD Graphics performance from 'automatic' or 'hardware' to 'software' graphics acceleration. You can see the setting here: Android AVD graphics acceleration setting picture

You can read more about that setting here: Configure Hardware Acceleration for the Android Emulator

I believe this has something to do with Nvidia drivers and the android emulator, as I only got the problem on the display using a Nvidia GPU and not the display using the Intel integrated one... which is disappointing not to be able to take advantage of the better GPU for graphics acceleration.



回答4:

Thanks to the hint provided by Serjux's answer, I resolved my similar problem - Android emulators freeze immediately when moved from one monitor to another. They worked fine without this problem until I upgraded my PC from Intel i5-3570K to AMD Ryzen 7 2700 while the video card GeForce GTX 1050 remained. I use Hyper-V versions of Android emulators. For hw.gpu.mode, I have tried auto, host, angle, mesa, and found only mesa works fine: