Android Studio-模拟器未运行

时间:2020-10-16 16:40:58

标签: android android-studio adb

我收到错误消息“ 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 

3 个答案:

答案 0 :(得分: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上手动检查,是否看到模拟器图像?然后发表评论

答案 1 :(得分:0)

我是按照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相关的环境变量的三个名称, 然后,我添加ANDROID_AVD_HOME指向C:\ users \ myusername \ .android \ avd

答案 2 :(得分:-1)

在我的机器上,我只有 2GB 的可用磁盘空间。一旦我释放了一些高达 ~10GB 的磁盘空间,模拟器就可以正常启动了。