首页 > 解决方案 > 为什么我的项目会在我的手机上运行,​​而不是我的 AVD?

问题描述

我已经创建了一个项目,它可以正常运行,并且按照我需要的方式运行。问题是,我需要它在我的手机和我的 AVD 上运行。当我打开我的 AVD 时,Nexus 5X API 28AVD 将打开没有问题,但项目不会运行。这是我的event log. 我无法弄清楚这意味着什么,因为我是新创建的 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

标签: androidandroid-studio

解决方案


以下是一些可以帮助您的提示:

  • 冷启动模拟器并重新安装apk。
    AVD 管理器 -> 操作 -> 向下箭头:立即冷启动 -> 删除应用程序 -> 尝试安装并再次运行它(看看 Logcat)
    • 清理并重建您的项目:构建 -> 清理项目 -> 构建 -> 重建项目
    • 使缓存无效并重新启动 IDE:文件 -> 使缓存无效/重新启动

推荐阅读