运行 Android 应用程序出错 - 无法初始化 OpenglES 仿真,使用“-gpu off”禁用它

Error while Running Android Application - Could not initialize OpenglES emulation, use '-gpu off' to disable it

我是 android 编程新手。我参考 google 开发者网站来学习 android。当我 运行 一个应用程序 UI 时,我遇到了这些错误。

 H:\SDK\tools\emulator.exe -avd Nexus_5_API_21_x86 -netspeed full -netdelay none
 emulator: ERROR: Could not initialize OpenglES emulation, use '-gpu off' to   disable it.
 could not get wglGetExtensionsStringARB
 could not get wglGetExtensionsStringARB
 could not get wglGetExtensionsStringARB
 could not get wglGetExtensionsStringARB
 could not get wglGetExtensionsStringARB
 could not get wglGetExtensionsStringARB
 could not get wglGetExtensionsStringARB
 could not get wglGetExtensionsStringARB
 getGLES1ExtensionString: Could not find GLES 1.x config!
 Failed to obtain GLES 1.x extensions string!
 Could not initialize emulated framebuffer

我正在使用 android 工作室。

我最近遇到了同样的问题,出现这个问题是因为 AVD 尝试使用系统的显卡渲染图形,但由于您的系统的图形驱动程序不是最新的或者它不支持这一点而无法做到这一点所以这里是解决方案。

第 1 步:

  • 更新您的操作系统图形驱动程序。
  • 重新启动系统。
  • 将系统的屏幕分辨率设置得尽可能高。
  • 立即尝试启动您的 AVD。

第 2 步:

  • 如果第 1 步失败,请转到 AVD 管理器。
  • 编辑您的 AVD。
  • 取消选中 'Use Host GPU' 选项。
  • 点击完成(保存)。
  • 再次启动 AVD。

确保您 运行 您的 AVD 管理器不是来自 eclipse 转到安装目录 android/AVD manager.exe 并以管理员身份右键单击 运行 然后进行更改.

我只是 运行 进入这个,那是因为我 运行 通过 Windows 远程桌面。当我在本地登录时它工作正常。

  • 转到 AVD 管理器。
  • 编辑您的 AVD。
  • Select 'Software GLES2.0' 模拟性能选项。 (原因是部分用户没有安装显卡驱动)
  • 单击完成(保存)。
  • 再次启动AVD。

配置新设备时,对 "Emulated Performance" 类别下的图形使用选项 "Software - GLES 2.0"。一旦您在配置 AVD 时单击 "Show Advanced Settings",就会看到此选项。

我的 运行s Windows 10 笔记本电脑上有一个非常相似的问题,它有两个 GPU:一个在 Intel 处理器中,另一个是 Nvidia。当系统使用低性能 Intel GPU 时出现此错误。我需要 "run" Android Studio 和 "High performance NVIDIA processor" 通过右击应用程序 link 然后 "Run with graphics processor" 然后 "High-performance NVIDIA processor"

大部分程序都可以与 NVIDIA 运行

不幸的是,这不适用于我的 Android Studio 应用程序 link。我必须转到“设置”>“显示”>“图形设置”>“浏览”,然后选择 Android Studio 可执行文件(studio,然后是 studio64,我为它们都做了) 然后应用程序出现在浏览按钮下方,select 应用程序,然后是选项,然后是 select 高性能。