【问题标题】:Android Studio Error | Emulator: emulator: ERROR: VkCommonOperations.cpp:496: Failed to create Vulkan instanceAndroid Studio 错误 |模拟器:模拟器:错误:VkCommonOperations.cpp:496:无法创建 Vulkan 实例
【发布时间】:2020-03-17 08:37:14
【问题描述】:

正如标题所示,我的 Linux Mint 19.3 上的 Android Studio 存在问题。我尝试通过官方下载页面、软件管理器安装 Android Studio,现在通过 snap 安装最新版本。当我尝试在 android studio 3.6.1 中启动应用程序时,创建 vulkan 实例失败是许多错误中的第一个错误。模拟器屏幕是黑色的,没有任何反应。

我在Dell XPS 13 9343 和Kernel: 5.3.0-40-generic x86_64 上运行Linux Mint 19.3 Tricia base: Ubuntu 18.04 bionic。我已经安装了所有驱动程序。

这是我尝试启动应用时的事件日志:

17.3.2020
10:32   Executing tasks: [:app:assembleDebug] in project /home/samuel/Downloads/Exemple2

10:32   Emulator: emulator: ERROR: VkCommonOperations.cpp:496: Failed to create Vulkan instance.

10:32   Emulator: emulator: WARNING: EmulatorService.cpp:448: Cannot find certfile: /home/samuel/.android/emulator-grpc.cer security will be disabled.

10:32   Emulator: E0317 10:32:43.165019034   12845 socket_utils_common_posix.cc:201] check for SO_REUSEPORT: {"created":"@1584433963.164985521","description":"SO_REUSEPORT unavailable on compiling system","file":"/mnt/tmpfs/src/android/emu-master-dev/external/grpc/src/core/lib/iomgr/socket_utils_common_posix.cc","file_line":169}

10:32   Emulator: Started GRPC server at 127.0.0.1:8554

10:32   Gradle build finished in 1 s 288 ms

【问题讨论】:

    标签: android-studio


    【解决方案1】:

    在了解这是 GPU 问题后,我找到了启动模拟器的方法...

    sudo ubuntu-drivers autoinstall
    

    升级了我的 Nvidia GPU 驱动程序并将问题更改为另一个问题:

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

    所以根据this issue和this answer 我将模拟设备更改为允许我为图形更改“软件-GLE 2.0”的设备,而不是选择“自动”或“硬件-GLE 2.0”(在软件中模拟图形)(并非所有设备都允许更改它) 我使用 Galaxy Nexus API 30 - R 并且仿真工作,即使我仍然有这个 SO_REUSEPORT 错误! 希望它可以帮助某人...

    【讨论】:

      【解决方案2】:

      在终端上运行此命令

      sudo apt-get install mesa-vulkan-drivers
      

      【讨论】:

      • 当我第一次来到这里时,有人对这个答案投了反对票,但这对我有用。
      猜你喜欢
      • 2017-12-15
      • 2020-12-27
      • 2018-08-09
      • 2016-09-14
      • 2018-08-06
      • 1970-01-01
      • 2011-01-05
      • 2016-08-04
      • 1970-01-01
      相关资源
      最近更新 更多