如何让Android Studio虚拟设备运行(停止终止)?
Android Studio Chipmunk(2021.2.1)
这是我第一次使用Android Studio,我正在尝试让Android模拟器工作,开始学习Java。每次我尝试运行模拟器时,都会收到以下消息:The emulator process for AVD {device-name} has terminated.
我觉得我已经尝试了我能在网上找到的一切。以下是我到目前为止所尝试的:
*检查我的磁盘空间为suggested here,甚至删除一些不必要的应用程序,尽管有足够的磁盘空间(远远超过80 GB)。
*删除所有虚拟设备,然后使用内置的设备管理器逐个重新安装。
*完全删除Android Emulator,并在SDK Tools(工具)〉SDK Manager(SDK管理器)应用程序菜单下的SDK Tools(工具)选项卡中重新安装。
*在C:\Users\ {name}\ .android\下创建advancedFeatures.ini文件,文件名为suggested here,在其他帖子中使用不同的行。
*重启我的PC和Android Studio在整个过程中,在这里提到的每一步之后。
*将Android Studio从我的系统中完全删除,然后下载(从官方网站)并重新安装。
*查看idea.log文件。有一堆关于模拟器的错误,我无法理解。
有人知道该怎么做吗?
以下是idea.log文件对模拟器的描述:
2022-05-16 10:23:53,804 [ 308433] WARN - alytics.SystemInfoStatsMonitor - CpuInfoFlags.fromExitCode(): unknown flag values '0x80'
2022-05-16 10:24:46,048 [ 360677] INFO - Emulator: Pixel 5 API Tiramisu - C:\Users\{username}\AppData\Local\Android\Sdk\emulator\emulator.exe -netdelay none -netspeed full -avd Pixel_5_API_Tiramisu -qt-hide-window -grpc-use-token -idle-grpc-timeout 300
2022-05-16 10:24:47,098 [ 361727] INFO - Emulator: Pixel 5 API Tiramisu - C:\Users\{username}\AppData\Local\Android\Sdk\emulator\emulator.exe -netdelay none -netspeed full -avd Pixel_5_API_Tiramisu -qt-hide-window -grpc-use-token -idle-grpc-timeout 300
2022-05-16 10:24:49,548 [ 364177] WARN - Emulator: Pixel 5 API Tiramisu - unexpected system image feature string, emulator might not function correctly, please try updating the emulator.
2022-05-16 10:24:49,564 [ 364193] INFO - Emulator: Pixel 5 API Tiramisu - Warning: Quick Boot / Snapshots not supported on this machine. A CPU with EPT + UG features is currently needed. We will address this in a future release.
2022-05-16 10:24:49,564 [ 364193] WARN - Emulator: Pixel 5 API Tiramisu - Not all modern X86 virtualization features supported, which introduces problems with slowdown when running Android on multicore vCPUs. Setting AVD to run with 1 vCPU core only.
2022-05-16 10:24:51,046 [ 365675] WARN - Emulator: Pixel 5 API Tiramisu - cannot add library vulkan-1.dll: failed
2022-05-16 10:24:51,046 [ 365675] WARN - Emulator: Pixel 5 API Tiramisu - cannot add library vulkan-1.dll: failed
2022-05-16 10:24:51,073 [ 365702] INFO - Emulator: Pixel 5 API Tiramisu - configAndStartRenderer: setting vsync to 60 hz
2022-05-16 10:24:51,073 [ 365702] INFO - Emulator: Pixel 5 API Tiramisu - Sending adb public key [QAAAAC03lzdbz2r7trf4HeurXGQ9LdN2Kex6Luf2QjY0wlgNvxm+NCxU0TyJXB+NOfqXcglhbuChvc1zyLz57tbnSrH5zzmXMzN4WmbS9BTW5uIuNfLGP+TQRdHvBiWvqgkOSOKqp4NQiclDOfet4EuGUqRvxGuKbEYLWMsVHfMnXWSOuuUr5hQl1s/MPKkthtC0fVTDJMQIV5xAN85Z9pUhUqOdxPyU4X8xvo/nFFOaZLD4h+UyKp4Yn6WXvm+Q0aceAr2YvEirpBUbj2KFoMzFP29kokuZTmtENhEF/WQXjQ8OhecQ99z3NUQdIhWDk3x8xKvkWepxWCtKVGn3jCJObE8c4bGt2OUmsWQkvVP/9/5wh+B0qLTtInXtoQiNman64QEvrZMYOPZxIJ+RNBExu5pJytEK5ntxQhQPUcL3aY+mNNCQotGXyJrxPIvtiEJyUFHfQcM+Ulned9eDGTNN0TcOOWjBcKUoMt9NllZ5/mUCSsf0rgyy4YvtLiqV/1EWxYo96kl+v8MH6jMiJN9MHgzPFZMt8+azTZGDoDIbo7T5aBvv3hvECUCiWwIdbhQmK6bKdNqjd8ovnF0hAcporw0iPC+mNWiC9onVToMgJE7oRwtCi42voElCDTl/+cuEVnBREVjk16I31fuWIewM6pBoSM7F3wwPbjRXbsedpuQ613f+HwEAAQA= @unknown]
2022-05-16 10:24:51,074 [ 365703] INFO - Emulator: Pixel 5 API Tiramisu - added library C:\Users\{username}\AppData\Local\Android\Sdk\emulator\lib64\vulkan\vulkan-1.dll
2022-05-16 10:24:51,074 [ 365703] INFO - Emulator: Pixel 5 API Tiramisu - Rootcanal has been activated.
2022-05-16 10:24:51,074 [ 365703] INFO - Emulator: Pixel 5 API Tiramisu - HAX is working and emulator runs in fast virt mode.
2022-05-16 10:24:51,508 [ 366137] INFO - b.PhysicalDeviceChangeListener - emulator-5554 connected
2022-05-16 10:24:51,510 [ 366139] INFO - Emulator: Pixel 5 API Tiramisu - Started GRPC server at 127.0.0.1:8554, security: Local+token
2022-05-16 10:24:51,511 [ 366140] INFO - Emulator: Pixel 5 API Tiramisu - Advertising in: C:\Users\{username}\AppData\Local\Temp\avd\running\pid_3028.ini
2022-05-16 10:24:51,915 [ 366544] INFO - Emulator: Pixel 5 API Tiramisu - VCPU shutdown request
2022-05-16 10:24:51,915 [ 366544] INFO - Emulator: Pixel 5 API Tiramisu - Deleting snapshot default_boot
2022-05-16 10:24:52,061 [ 366690] INFO - Emulator: Pixel 5 API Tiramisu - Shutting down gRPC endpoint
2022-05-16 10:24:52,062 [ 366691] INFO - Emulator: Pixel 5 API Tiramisu - Shutting down gRPC endpoint
2022-05-16 10:24:52,074 [ 366703] INFO - Emulator: Pixel 5 API Tiramisu - Closing down rootcanal.
2022-05-16 10:24:52,473 [ 367102] ERROR - Emulator: Pixel 5 API Tiramisu - Running multiple emulators with the same AVD
2022-05-16 10:24:52,474 [ 367103] ERROR - Emulator: Pixel 5 API Tiramisu - Android Studio Chipmunk | 2021.2.1 Build #AI-212.5712.43.2112.8512546
2022-05-16 10:24:52,485 [ 367114] ERROR - Emulator: Pixel 5 API Tiramisu - JDK: 11.0.12; VM: OpenJDK 64-Bit Server VM; Vendor: Oracle Corporation
2022-05-16 10:24:52,486 [ 367115] ERROR - Emulator: Pixel 5 API Tiramisu - OS: Windows 10
2022-05-16 10:24:52,487 [ 367116] ERROR - Emulator: Pixel 5 API Tiramisu - Last Action:
2022-05-16 10:24:52,487 [ 367116] ERROR - Emulator: Pixel 5 API Tiramisu - is an experimental feature.
2022-05-16 10:24:52,487 [ 367116] ERROR - Emulator: Pixel 5 API Tiramisu - Android Studio Chipmunk | 2021.2.1 Build #AI-212.5712.43.2112.8512546
2022-05-16 10:24:52,487 [ 367116] ERROR - Emulator: Pixel 5 API Tiramisu - JDK: 11.0.12; VM: OpenJDK 64-Bit Server VM; Vendor: Oracle Corporation
2022-05-16 10:24:52,488 [ 367117] ERROR - Emulator: Pixel 5 API Tiramisu - OS: Windows 10
2022-05-16 10:24:52,488 [ 367117] ERROR - Emulator: Pixel 5 API Tiramisu - Last Action:
2022-05-16 10:24:52,488 [ 367117] ERROR - Emulator: Pixel 5 API Tiramisu - Please use -read-only flag to enable this feature.
2022-05-16 10:24:52,489 [ 367118] ERROR - Emulator: Pixel 5 API Tiramisu - Android Studio Chipmunk | 2021.2.1 Build #AI-212.5712.43.2112.8512546
2022-05-16 10:24:52,489 [ 367118] ERROR - Emulator: Pixel 5 API Tiramisu - JDK: 11.0.12; VM: OpenJDK 64-Bit Server VM; Vendor: Oracle Corporation
2022-05-16 10:24:52,489 [ 367118] ERROR - Emulator: Pixel 5 API Tiramisu - OS: Windows 10
2022-05-16 10:24:52,490 [ 367119] ERROR - Emulator: Pixel 5 API Tiramisu - Last Action:
2022-05-16 10:24:52,491 [ 367120] INFO - Emulator: Pixel 5 API Tiramisu - Android emulator version 31.2.10.0 (build_id 8420304) (CL:N/A)
2022-05-16 10:24:52,588 [ 367217] INFO - Emulator: Pixel 5 API Tiramisu - Process finished with exit code 1
2022-05-16 10:24:52,588 [ 367217] ERROR - Emulator: Pixel 5 API Tiramisu - Emulator terminated with exit code 1
java.lang.Throwable: Emulator terminated with exit code 1
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:182)
at com.android.tools.idea.avdmanager.EmulatorProcessHandler$ConsoleListener.onTextAvailable(EmulatorProcessHandler.kt:89)
at jdk.internal.reflect.GeneratedMethodAccessor62.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.intellij.execution.process.ProcessHandler$2.invoke(ProcessHandler.java:247)
at com.sun.proxy.$Proxy33.onTextAvailable(Unknown Source)
at com.intellij.execution.process.ProcessHandler.notifyTextAvailable(ProcessHandler.java:221)
at com.intellij.execution.process.ProcessTerminatedListener.processTerminated(ProcessTerminatedListener.java:54)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.intellij.execution.process.ProcessHandler$2.invoke(ProcessHandler.java:247)
at com.sun.proxy.$Proxy33.processTerminated(Unknown Source)
at com.intellij.execution.process.ProcessHandler.lambda$notifyTerminated$2(ProcessHandler.java:205)
at com.intellij.execution.process.ProcessHandler$TasksRunner.execute(ProcessHandler.java:280)
at com.intellij.execution.process.ProcessHandler.notifyTerminated(ProcessHandler.java:188)
at com.intellij.execution.process.ProcessHandler.notifyProcessTerminated(ProcessHandler.java:184)
at com.intellij.execution.process.BaseProcessHandler.onOSProcessTerminated(BaseProcessHandler.java:61)
at com.intellij.execution.process.BaseOSProcessHandler$1.lambda$startNotified$0(BaseOSProcessHandler.java:99)
at com.intellij.execution.process.ProcessWaitFor.lambda$new$0(ProcessWaitFor.java:45)
at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:213)
at com.intellij.execution.process.ProcessWaitFor.lambda$new$1(ProcessWaitFor.java:23)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
at java.base/java.lang.Thread.run(Thread.java:829)
2022-05-16 10:24:52,591 [ 367220] ERROR - Emulator: Pixel 5 API Tiramisu - Android Studio Chipmunk | 2021.2.1 Build #AI-212.5712.43.2112.8512546
2022-05-16 10:24:52,592 [ 367221] ERROR - Emulator: Pixel 5 API Tiramisu - JDK: 11.0.12; VM: OpenJDK 64-Bit Server VM; Vendor: Oracle Corporation
2022-05-16 10:24:52,592 [ 367221] ERROR - Emulator: Pixel 5 API Tiramisu - OS: Windows 10
2022-05-16 10:24:52,593 [ 367222] ERROR - Emulator: Pixel 5 API Tiramisu - Last Action:
2022-05-16 10:24:53,887 [ 368516] INFO - Emulator: Pixel 5 API Tiramisu - Android emulator version 31.2.10.0 (build_id 8420304) (CL:N/A)
2022-05-16 10:24:53,950 [ 368579] INFO - Emulator: Pixel 5 API Tiramisu - Process finished with exit code 0
2022-05-16 10:24:54,122 [ 368751] INFO - b.PhysicalDeviceChangeListener - emulator-5554 disconnected
2022-05-16 10:25:38,691 [ 413320] INFO - rationStore.ComponentStoreImpl - Saving appClangTidySettings took 16 ms, NotificationConfiguration took 15 ms, YamlEditorOptions took 16 ms
2022-05-16 10:25:38,769 [ 413398] INFO - rationStore.ComponentStoreImpl - Saving Project(name=Learning_Environment, containerState=COMPONENT_CREATED, componentStore=C:\Users\{username}\AndroidStudioProjects\Learning_Environment)FileEditorManager took 15 ms, ServiceViewManager took 16 ms, Vcs.Log.Tabs.Properties took 16 ms, XDebuggerManager took 15 ms
3条答案
按热度按时间brgchamk1#
尝试将模拟器的图形从自动更改为软件
flvtvl502#
我不知道这个问题的确切原因-它似乎与图形有关的东西,并发生在最后一次模拟器更新后,在我的情况。
帮助我的是使用控制台运行模拟器和更改图形设置。我使用的是Ubuntu 20.04,所以所有路径都是Linux。
1.列出您的所有avds:
$./emulator -list-avds
1.然后用软件加速模式启动avd:
$./emulator -avd MY_AVD_NAME -gpu swiftshader_indirect
-这条线开始了我的avd。这足以使用模拟器。1.(可选)我希望能够从Android Studio启动模拟器,因此尝试了avd中的不同设置,效果如下:x1c 0d1x在此之后,您可以从AS或仅使用
$./emulator -avd MY_AVD_NAME
运行avd看起来还有一种替代方法:更改
/home/user/.android/avd/MY_AVD_NAME.avd/config.ini
文件中的设置:谷歌链接:https://developer.android.com/studio/run/emulator-acceleration#command-gpu
mbzjlibv3#
执行模拟器的冷 Boot ;无需重新安装或更改任何设置。这可能是设备未正确关闭时的问题。x1c 0d1x