【问题标题】:Android Studio - Emulator not runningAndroid Studio - 模拟器未运行
【发布时间】:2020-10-16 16:40:58
【问题描述】:

我收到错误消息“avd 的模拟器进程已被终止”,我已经研究了这方面的类似问题,并尝试了重新安装 haxm 和运行全新安装的 android studio 之类的方法。

这是日志,请有人教我,我很沮丧

2020-10-16 17:08:00,561 [   1348]   INFO - gs.impl.UpdateCheckerComponent - channel: release 
2020-10-16 17:08:00,628 [   1415]   WARN - nSystem.impl.ActionManagerImpl - keymap "ReSharper" not found [Plugin: com.android.tools.ndk] 
2020-10-16 17:08:00,648 [   1435]   WARN - nsions.impl.ExtensionPointImpl - Extension to be removed not found: class org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer 
2020-10-16 17:08:00,762 [   1549]   WARN - Container.ComponentManagerImpl - Do not use constructor injection (requestorClass=com.android.tools.idea.apk.symbols.DebugSymbolNotifications) 
2020-10-16 17:08:01,200 [   1987]   INFO - rd.FirstRunWizardFrameProvider - Overriding welcome frame to be resizable 
2020-10-16 17:08:06,410 [   7197]   INFO - manager.EmulatorProcessHandler - Emulator: C:\Users\Cian\AppData\Local\Android\Sdk\emulator\emulator.exe -netdelay none -netspeed full -avd Pixel_4 
2020-10-16 17:08:06,427 [   7214]   INFO - roid.tools.idea.adb.AdbService - Initializing adb using: C:\Users\Cian\AppData\Local\Android\Sdk\platform-tools\adb.exe 
2020-10-16 17:08:06,439 [   7226]   INFO - manager.EmulatorProcessHandler - Emulator: emulator: ERROR: Unknown AVD name [Pixel_4], use -list-avds to see valid list. 
2020-10-16 17:08:06,439 [   7226]   INFO - manager.EmulatorProcessHandler - Emulator: ANDROID_SDK_HOME is defined but there is no file Pixel_4.ini in $ANDROID_SDK_HOME\avd 
2020-10-16 17:08:06,439 [   7226]   INFO - manager.EmulatorProcessHandler - Emulator: (Note: Directories are searched in the order $ANDROID_AVD_HOME, $ANDROID_SDK_HOME\avd and $HOME\.android\avd) 
2020-10-16 17:08:06,440 [   7227]   INFO - manager.EmulatorProcessHandler - Emulator: Process finished with exit code 1 
2020-10-16 17:08:06,441 [   7228]   WARN - manager.EmulatorProcessHandler - Emulator terminated with exit code 1 
2020-10-16 17:08:08,508 [   9295]   WARN -            #com.android.ddmlib - * daemon not running; starting now at tcp:5037 
2020-10-16 17:08:08,529 [   9316]   WARN -            #com.android.ddmlib - * daemon started successfully 
2020-10-16 17:08:08,537 [   9324]   INFO -            #com.android.ddmlib - Connected to adb for device monitoring 
2020-10-16 17:08:08,736 [   9523]   INFO - roid.tools.idea.adb.AdbService - Successfully connected to adb 

编辑日志

2020-10-16 18:12:02,605 [ 881852]   INFO - manager.EmulatorProcessHandler - Emulator: C:\Users\Cian\AppData\Local\Android\Sdk\emulator\emulator.exe -netdelay none -netspeed full -avd Pixel_4_XL_API_30 
2020-10-16 18:12:02,631 [ 881878]   INFO - manager.EmulatorProcessHandler - Emulator: emulator: ERROR: Unknown AVD name [Pixel_4_XL_API_30], use -list-avds to see valid list. 
2020-10-16 18:12:02,631 [ 881878]   INFO - manager.EmulatorProcessHandler - Emulator: ANDROID_SDK_HOME is defined but there is no file Pixel_4_XL_API_30.ini in $ANDROID_SDK_HOME\avd 
2020-10-16 18:12:02,631 [ 881878]   INFO - manager.EmulatorProcessHandler - Emulator: (Note: Directories are searched in the order $ANDROID_AVD_HOME, $ANDROID_SDK_HOME\avd and $HOME\.android\avd) 
2020-10-16 18:12:02,631 [ 881878]   INFO - manager.EmulatorProcessHandler - Emulator: Process finished with exit code 1 
2020-10-16 18:12:02,631 [ 881878]   WARN - manager.EmulatorProcessHandler - Emulator terminated with exit code 1 
2020-10-16 18:12:32,480 [ 911727]   INFO - manager.EmulatorProcessHandler - Emulator: C:\Users\Cian\AppData\Local\Android\Sdk\emulator\emulator.exe -netdelay none -netspeed full -avd Pixel_4_XL_API_30 
2020-10-16 18:12:32,506 [ 911753]   INFO - manager.EmulatorProcessHandler - Emulator: emulator: ERROR: Unknown AVD name [Pixel_4_XL_API_30], use -list-avds to see valid list. 
2020-10-16 18:12:32,506 [ 911753]   INFO - manager.EmulatorProcessHandler - Emulator: ANDROID_SDK_HOME is defined but there is no file Pixel_4_XL_API_30.ini in $ANDROID_SDK_HOME\avd 
2020-10-16 18:12:32,506 [ 911753]   INFO - manager.EmulatorProcessHandler - Emulator: (Note: Directories are searched in the order $ANDROID_AVD_HOME, $ANDROID_SDK_HOME\avd and $HOME\.android\avd) 
2020-10-16 18:12:32,506 [ 911753]   INFO - manager.EmulatorProcessHandler - Emulator: Process finished with exit code 1 
2020-10-16 18:12:32,506 [ 911753]   WARN - manager.EmulatorProcessHandler - Emulator terminated with exit code 1 

【问题讨论】:

    标签: android android-studio adb


    【解决方案1】:

    ANDROID_SDK_HOME is defined but there is no file Pixel_4.ini in $ANDROID_SDK_HOME\avd

    您似乎配置了一个没有图像的模拟器,或者图像可能稍后被删除。

    您所要做的就是下载一个有效的模拟器映像,然后重新配置模拟器,然后您就可以期待一切正常工作了

    [编辑]:基于相关更新

    日志中有两条重要消息

    • Unknown AVD name [Pixel_4_XL_API_30], use -list-avds to see valid list
    • ANDROID_SDK_HOME is defined but there is no file Pixel_4_XL_API_30.ini in $ANDROID_SDK_HOME\avd

    在第一个错误中,似乎模拟器没有运行,所以错误是关于那个

    在第二个错误中,可能存在路径不匹配,导致模拟器在运行之前找不到图像。

    所以你在路径$ANDROID_SDK_HOME\avd 手动检查你看到你的模拟器图像了吗?然后评论回来

    【讨论】:

    • 我在 android studio 中这样做吗?
    • 是的,当从 android studio 的菜单中选择模拟器或设备时,只需单击添加新模拟器或此类选项,然后从头开始创建模拟器。确保您已下载正确的图片
    • 我下载了不同的图像,但也不起作用。
    • 图像大小约为 1GB。你确定你下载了新图片吗?发布你得到的新错误日志
    • 添加到原始问题
    【解决方案2】:

    我按照 Github https://github.com/intel/haxm/wiki/Installation-Instructions-on-Windows#Installing_Intel_HAXM_on_Windows_via_Android_Studio 上的说明完成了这项工作

    设置用户变量 ANDROID_SDK_HOME 到 C:\users\myusername\AppData\Local\Android\SDK 然后在命令提示符下, 启动 %ANDROID_SDK_ROOT%\tools\emulator –avd -verbose –show-kernel 结果显示了与 AVD 相关的环境变量的三个名称, 然后我添加了指向 C:\users\myusername\ .android\avd

    的 ANDROID_AVD_HOME

    【讨论】:

      【解决方案3】:

      在我的机器上,我只有 2GB 的可用磁盘空间。一旦我释放了大约 10GB 的磁盘空间,模拟器就可以启动了。

      【讨论】:

        猜你喜欢
        • 2017-07-31
        • 2016-09-13
        • 1970-01-01
        • 1970-01-01
        • 2018-09-10
        • 1970-01-01
        • 2017-12-19
        • 2020-08-17
        • 1970-01-01
        相关资源
        最近更新 更多