Android Emulator hypervisor driver安装一直弹出黑窗口安装失败 ...

打印 上一主题 下一主题

主题 898|帖子 898|积分 2694

Android Emulator hypervisor driver安装失败办理
朋侪,当你看到这篇文章,信赖之前也搜索过很多办理博客,也信赖了其他大佬说法,是因为电脑CPU差别或硬件情况导致的,终极还得看官方表明。
一、电脑情况和安装地址

github安装链接
电脑安装条件:
1、CPU 具有虚拟化扩展,并且 BIOS 尚未禁用该扩展。(CPU开启虚拟化,使命管理器可以看到,如下图)
2、必须禁用 Hyper-V。 (命令提示符关闭,以管理员身份运行命令提示符,实行命令:
bcdedit /set hypervisorlaunchtype off)

二、勾选Android Emulator hypervisor driver,进行安装:

安装后会报错,同时在{android-sdk}\extras\google\Android_Emulator_Hypervisor_Driver目次下安装文件silent_install.bat 等。
三、在{android-sdk}\extras\google\Android_Emulator_Hypervisor_Driver目次下实行silent_install.bat,报错同步骤二。
办理步骤如下:
1、起首参考了文章:https://blog.csdn.net/qq_37242224/article/details/107625180
安装了工具检测,对我办理题目也没有啥用,
2、然后参考文章:https://blog.csdn.net/gonghui_gonghui/article/details/136069862
这篇文章照旧有作用的,重要是把{android-sdk}\extras\google\Android_Emulator_Hypervisor_Driver
文件夹下的silent_install.bat 内容用以下代码更换掉:
  1. @echo off
  2. :-------------------------------------
  3. Check for admin rights
  4. fltmc >nul 2>&1
  5. if %errorlevel% NEQ 0 (
  6.   echo Requesting administrative privileges...
  7.   goto getAdmin
  8. )
  9. :gotAdmin
  10. pushd "%CD%"
  11. CD /D "%~dp0"
  12. :--------------------------------------
  13. Parse commands
  14. set action=install
  15. :parseInput
  16. if "%~1"=="" (
  17.   goto %action%
  18. )
  19. if /i "%~1"=="-u" (
  20.   set action=uninstall
  21.   shift
  22.   goto parseInput
  23. )
  24. if /i "%~1"=="-v" (
  25.   set action=checkinstall
  26.   shift
  27.   goto parseInput
  28. )
  29. REM Ignore other params
  30. shift
  31. goto parseInput
  32. :getAdmin
  33. >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
  34. if '%errorlevel%' NEQ '0' (
  35.   echo Requesting administrative privileges...
  36.   goto UACPrompt
  37. ) else ( goto gotAdmin )
  38. :UACPrompt
  39. echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
  40. echo UAC.ShellExecute "cmd.exe", "/c %~s0 %*", "", "runas", 1 >> "%temp%\getadmin.vbs"
  41. "%temp%\getadmin.vbs"
  42. del "%temp%\getadmin.vbs"
  43. exit /B
  44. :install
  45. sc query gvm >nul 2>&1
  46. if %errorlevel% EQU 0 (
  47.   sc stop gvm
  48.   sc delete gvm
  49. )
  50. RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection DefaultInstall 132 .\gvm.inf
  51. if %errorlevel% NEQ 0 (
  52.   echo Failed to install GVM
  53.   exit /b 1
  54. )
  55. sc start gvm
  56. exit /b 0
  57. :uninstall
  58. sc query gvm >nul 2>&1
  59. if %errorlevel% NEQ 0 exit /b 0
  60. sc stop gvm
  61. sc delete gvm
  62. if %errorlevel% NEQ 0 (
  63.   echo Failed to uninstall GVM
  64.   exit /b 1
  65. )
  66. exit /b 0  
  67. :checkinstall
  68. sc query gvm >nul 2>&1
  69. if %errorlevel% EQU 0 (
  70.   exit /b 0
  71. ) else (
  72.   exit /b 1
  73. )
复制代码
3、更换完后,在Check for admin rights、 Parse commands前添加REM,如下:
  1. REM  Check for admin rights
  2. REM  Parse commands
复制代码
然后再运行silent_install.bat 。
4、信赖有的朋侪照旧会报错,别急,可能你的CPU没有大题目。
下面请看Android Studio官方表明:

信赖看到这就知道了,要保持版本跟服务名称同等,以是请注意看上面图中,即下图对应的版本是2.2.0

以是要在silent_install.bat里把所有的“gvm”改为“”aehd“,然后再运行silent_install.bat,信赖到这步,很多朋侪就会看到乐成的曙光了。
silent_install.bat经过更换、添加、更换“gvm”->“aehd”,完备的更换代码如下:
  1. @echo off
  2. :-------------------------------------
  3. REM Check for admin rights
  4. fltmc >nul 2>&1
  5. if %errorlevel% NEQ 0 (
  6.   echo Requesting administrative privileges...
  7.   goto getAdmin
  8. )
  9. :gotAdmin
  10. pushd "%CD%"
  11. CD /D "%~dp0"
  12. :--------------------------------------
  13. REM Parse commands
  14. set action=install
  15. :parseInput
  16. if "%~1"=="" (
  17.   goto %action%
  18. )
  19. if /i "%~1"=="-u" (
  20.   set action=uninstall
  21.   shift
  22.   goto parseInput
  23. )
  24. if /i "%~1"=="-v" (
  25.   set action=checkinstall
  26.   shift
  27.   goto parseInput
  28. )
  29. REM Ignore other params
  30. shift
  31. goto parseInput
  32. :getAdmin
  33. >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
  34. if '%errorlevel%' NEQ '0' (
  35.   echo Requesting administrative privileges...
  36.   goto UACPrompt
  37. ) else ( goto gotAdmin )
  38. :UACPrompt
  39. echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
  40. echo UAC.ShellExecute "cmd.exe", "/c %~s0 %*", "", "runas", 1 >> "%temp%\getadmin.vbs"
  41. "%temp%\getadmin.vbs"
  42. del "%temp%\getadmin.vbs"
  43. exit /B
  44. :install
  45. sc query aehd >nul 2>&1
  46. if %errorlevel% EQU 0 (
  47.   sc stop aehd
  48.   sc delete aehd
  49. )
  50. RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection DefaultInstall 132 .\aehd.inf
  51. if %errorlevel% NEQ 0 (
  52.   echo Failed to install aehd
  53.   exit /b 1
  54. )
  55. sc start aehd
  56. exit /b 0
  57. :uninstall
  58. sc query aehd >nul 2>&1
  59. if %errorlevel% NEQ 0 exit /b 0
  60. sc stop aehd
  61. sc delete aehd
  62. if %errorlevel% NEQ 0 (
  63.   echo Failed to uninstall aehd
  64.   exit /b 1
  65. )
  66. exit /b 0  
  67. :checkinstall
  68. sc query aehd >nul 2>&1
  69. if %errorlevel% EQU 0 (
  70.   exit /b 0
  71. ) else (
  72.   exit /b 1
  73. )
复制代码
原文参考:
https://blog.csdn.net/gonghui_gonghui/article/details/136069862
https://github.com/google/android-emulator-hypervisor-driver/issues/88
https://blog.csdn.net/qq_37242224/article/details/107625180
https://developer.android.google.cn/studio/run/emulator-acceleration.html?hl=el

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

慢吞云雾缓吐愁

金牌会员
这个人很懒什么都没写!

标签云

快速回复 返回顶部 返回列表