Android studio emulator white screen

核能气质少年 提交于 2019-12-04 12:33:34

问题


I've Installed the newest version of Android studio, including the newest version of HAXM, ndk, sdk and whatever other related dependencies it installs. Intel Virtualization bios setting thingy I can't remember the name of is enabled and I have no trouble in virtual box and such.

I created an empty activity and tried testing it on the phone, works perfectly. Then I tried it on the emulator and there is a problem when it is hardware accelerated. It just opens a white window. The android studio displays 0 errors and thinks it ran the app properly. The graphics card I have is a gtx 1060 6gb. When it is software accelerated it works but is so slow I would rather use a chisel on a rock to draw the application usage.

So if someone knows a fix it would be nice.

Thanks


回答1:


Well I have discovered that in order to solve the issue you have to go to the sidebar menu click More>Settings>OpenGL ES Renderer and(in my case) set it to Angle(D3D11) or Angle(D3D9) or Swiftshader. After that you simply restart the emulator and the issue should be gone.

For me Desktop native OpenGL and Autodetect based on host(which probably sets it to the first thing) don't work and leave you with a white screen.




回答2:


In case someone finds this useful, you can set software acceleration as below and this solved the issue for me on Mac OS. (OP also mentions it works with software acceleration)

  1. Tools > AVD Manager
  2. Select virtual device
  3. Click on Edit (pencil icon for me)
  4. Click "Show Advanced Settings"
  5. Look for Emulated Performance - Graphics
  6. Select "Software" option



回答3:


Current version of the emulator (27.1.3) doesn't work for me. The emulator just shows a white screen. Even playing with the gpu in the .ini configuration didn't work. Once I downgraded to 26.1.4 (https://dl.google.com/android/repository/emulator-darwin-4266726.zip) the emulator started working again.




回答4:


It seems that the Android Emulator is somehow conflicting with the NVidia Web driver on Mac OS. I had the latest NVidia Web driver (378.05.05.25f04) installed and I was having this same problem - the white screen whenever I used Desktop Native rendering (or left it at the automatic default which selects that as well).

I tried the Swift Shader as well, it works but the performance is abysmal!

On a hunch, I switched back to the OS X Default Graphic Driver from the Nvidia Pref Pane in Apple menu settings, and the Desktop Native driver is now working great after the computer restart!




回答5:


The same problem can happen to the lightning fast Microsoft Android Emulators utilizing Hyper-V that work on both Intel and AMD CPU based PCs. The solution is in the same line as the accepted answer. For those who use Microsoft Android Emulators and land here by searching "android emulator white screen", here is the screenshot showing how to solve the problem by changing the default hw.gpu.mode from the default "auto" to "mesa":



来源:https://stackoverflow.com/questions/47127545/android-studio-emulator-white-screen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!