我已经创建了一个项目,它以我需要的方式正常运行。问题是,我需要它在我的手机和我的 AVD 上运行。当我打开我的 AVD(即 Nexus 5X API 28
)时,AVD 打开没有问题,但项目将无法运行。以下是我的事件日志
中显示的内容。我无法理解这意味着什么,因为我是 android 的新手,但如果有人能告诉我这意味着什么,它会有所帮助吗?谢谢。
14:59 Project setup started
14:59 Gradle sync finished in 6 s 791 ms (from cached state)
14:59 * daemon not running; starting now at tcp:5037
14:59 * daemon started successfully
15:00 Emulator: 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.
15:00 Emulator: dsound: Could not initialize DirectSoundCapture
15:00 Emulator: dsound: Reason: No sound driver is available for use, or the given GUID is not a valid DirectSound device ID
15:00 Emulator: dsound: Attempt to initialize voice without DirectSoundCapture object
15:00 Emulator: dsound: Attempt to initialize voice without DirectSoundCapture object
15:00 Emulator: audio: Failed to create voice `goldfish_audio_in'
15:00 Emulator: C:\Users\PC_User\AppData\Local\Android\Sdk\emulator\qemu\windows-x86_64\qemu-system-x86_64.exe: warning: opening audio input failed
15:00 Emulator: dsound: Attempt to initialize voice without DirectSoundCapture object
15:00 Emulator: dsound: Attempt to initialize voice without DirectSoundCapture object
15:00 Emulator: audio: Failed to create voice `adc'
15:02 Executing tasks: [:app:assembleDebug]
15:03 Gradle build finished in 1 m 35 s 896 ms
最佳答案
以下是一些可能对您有所帮助的提示:
- 冷启动模拟器并重新安装 apk。
AVD Manager -> Actions -> Arrow Down: Cold Boot Now -> 删除应用程序 -> 尝试安装并再次运行它(看看 Logcat)- 清理并重建您的项目:构建 -> 清理项目 -> 构建 -> 重建项目
- 使缓存无效并重新启动 IDE:文件 -> 使缓存无效/重新启动
关于android - 为什么我的项目会在我的手机上运行而不是我的 AVD?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54184204/