Android Studio 无法 运行 AVD...超时
Android Studio can't run AVD... times out
刚买了一个新的 M1 Mac Mini,我 运行 在我的 Android 项目中遇到了问题。
我正在使用 Android Studio (Bumblebee)、JDK 11(也尝试过 17)和 Gradle 7.3。
当我尝试从 AS 运行 项目时,它构建良好,然后卡在“等待目标设备上线”并最终超时。
如果我再次尝试 运行 模拟器,我会收到一条消息,指出设备已经 运行ning,包括锁定文件的路径。
但是,我发现如果我从 CLI 手动 运行 模拟器,模拟器 会 打开,此时我 可以 获取 AS 到 运行 所述模拟器上的应用程序。所以问题显然只是AS无法打开 AVD。
当运行ning模拟器通过adelphia$ emulator -avd Pixel_3a_API_32_arm64-v8a
时的命令行输出:
adelphia$ emulator -avd Pixel_3a_API_32_arm64-v8a
INFO | Android emulator version 31.2.6.0 (build_id 8100890) (CL:N/A)
WARNING | unexpected system image feature string, emulator might not function correctly, please try updating the emulator.
INFO | Warning: QMetaObject::connectSlotsByName: No matching signal for on_new_posture_requested(int) ((null):0, (null))
INFO | Warning: QMetaObject::connectSlotsByName: No matching signal for on_dismiss_posture_selection_dialog() ((null):0, (null))
INFO | Warning: QMetaObject::connectSlotsByName: No matching signal for on_new_resizable_requested(PresetEmulatorSizeType) ((null):0, (null))
INFO | Warning: QMetaObject::connectSlotsByName: No matching signal for on_dismiss_resizable_dialog() ((null):0, (null))
WARNING | cannot add library /Users/adelphia/Library/Android/sdk/emulator/qemu/darwin-aarch64/lib64/vulkan/libvulkan.dylib: failed
INFO | added library /Users/adelphia/Library/Android/sdk/emulator/lib64/vulkan/libvulkan.dylib
INFO | configAndStartRenderer: setting vsync to 60 hz
INFO | Sending adb public key [QAAAAG8XVkhVwEAAQA....= adelphia@unknown]
INFO | Rootcanal has been activated.
Could not initialize record - Unknown Audiodevice
Could not initialize record - Unknown Audiodevice
Failed to create voice `goldfish_audio_in'
qemu-system-aarch64: warning: opening audio input failed
INFO | Started GRPC server at 127.0.0.1:8556, security: Local
INFO | Advertising in: /Users/adelphia/Library/Caches/TemporaryItems/avd/running/pid_1469.ini
Could not initialize record - Unknown Audiodevice
Could not initialize record - Unknown Audiodevice
Failed to create voice `adc'
Could not initialize record - Unknown Audiodevice
Could not initialize record - Unknown Audiodevice
Failed to create voice `adc'
如果相关,这是我的 .bash_profile
(改回 bash)
export PATH="/opt/homebrew/bin:$PATH"
export PATH="/opt/homebrew/sbin:$PATH"
export PATH="/Users/adelphia/Scripts:$PATH"
export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh
export ANDROID_HOME=~/Library/Android/sdk
export ANDROID_SDK_ROOT=~/Library/Android/sdk
export PATH=${PATH}:${ANDROID_HOME}/emulator
export PATH=${PATH}:${ANDROID_HOME}/tools
export PATH=${PATH}:${ANDROID_HOME}/platform-tools
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-11.0.14.jdk/Contents/Home
那么,如何让 AS 能够从 GUI 打开模拟器?
您必须在 IDE 中更新 AVD 工具。
Android 模拟器是 31.2.6
刚买了一个新的 M1 Mac Mini,我 运行 在我的 Android 项目中遇到了问题。
我正在使用 Android Studio (Bumblebee)、JDK 11(也尝试过 17)和 Gradle 7.3。
当我尝试从 AS 运行 项目时,它构建良好,然后卡在“等待目标设备上线”并最终超时。
如果我再次尝试 运行 模拟器,我会收到一条消息,指出设备已经 运行ning,包括锁定文件的路径。
但是,我发现如果我从 CLI 手动 运行 模拟器,模拟器 会 打开,此时我 可以 获取 AS 到 运行 所述模拟器上的应用程序。所以问题显然只是AS无法打开 AVD。
当运行ning模拟器通过adelphia$ emulator -avd Pixel_3a_API_32_arm64-v8a
时的命令行输出:
adelphia$ emulator -avd Pixel_3a_API_32_arm64-v8a
INFO | Android emulator version 31.2.6.0 (build_id 8100890) (CL:N/A)
WARNING | unexpected system image feature string, emulator might not function correctly, please try updating the emulator.
INFO | Warning: QMetaObject::connectSlotsByName: No matching signal for on_new_posture_requested(int) ((null):0, (null))
INFO | Warning: QMetaObject::connectSlotsByName: No matching signal for on_dismiss_posture_selection_dialog() ((null):0, (null))
INFO | Warning: QMetaObject::connectSlotsByName: No matching signal for on_new_resizable_requested(PresetEmulatorSizeType) ((null):0, (null))
INFO | Warning: QMetaObject::connectSlotsByName: No matching signal for on_dismiss_resizable_dialog() ((null):0, (null))
WARNING | cannot add library /Users/adelphia/Library/Android/sdk/emulator/qemu/darwin-aarch64/lib64/vulkan/libvulkan.dylib: failed
INFO | added library /Users/adelphia/Library/Android/sdk/emulator/lib64/vulkan/libvulkan.dylib
INFO | configAndStartRenderer: setting vsync to 60 hz
INFO | Sending adb public key [QAAAAG8XVkhVwEAAQA....= adelphia@unknown]
INFO | Rootcanal has been activated.
Could not initialize record - Unknown Audiodevice
Could not initialize record - Unknown Audiodevice
Failed to create voice `goldfish_audio_in'
qemu-system-aarch64: warning: opening audio input failed
INFO | Started GRPC server at 127.0.0.1:8556, security: Local
INFO | Advertising in: /Users/adelphia/Library/Caches/TemporaryItems/avd/running/pid_1469.ini
Could not initialize record - Unknown Audiodevice
Could not initialize record - Unknown Audiodevice
Failed to create voice `adc'
Could not initialize record - Unknown Audiodevice
Could not initialize record - Unknown Audiodevice
Failed to create voice `adc'
如果相关,这是我的 .bash_profile
(改回 bash)
export PATH="/opt/homebrew/bin:$PATH"
export PATH="/opt/homebrew/sbin:$PATH"
export PATH="/Users/adelphia/Scripts:$PATH"
export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh
export ANDROID_HOME=~/Library/Android/sdk
export ANDROID_SDK_ROOT=~/Library/Android/sdk
export PATH=${PATH}:${ANDROID_HOME}/emulator
export PATH=${PATH}:${ANDROID_HOME}/tools
export PATH=${PATH}:${ANDROID_HOME}/platform-tools
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-11.0.14.jdk/Contents/Home
那么,如何让 AS 能够从 GUI 打开模拟器?
您必须在 IDE 中更新 AVD 工具。 Android 模拟器是 31.2.6