android - 为什么我的项目会在我的手机上运行,而不是我的 AVD?
问题描述
我已经创建了一个项目,它可以正常运行,并且按照我需要的方式运行。问题是,我需要它在我的手机和我的 AVD 上运行。当我打开我的 AVD 时,Nexus 5X API 28
AVD 将打开没有问题,但项目不会运行。这是我的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
解决方案
以下是一些可以帮助您的提示:
- 冷启动模拟器并重新安装apk。
AVD 管理器 -> 操作 -> 向下箭头:立即冷启动 -> 删除应用程序 -> 尝试安装并再次运行它(看看 Logcat)- 清理并重建您的项目:构建 -> 清理项目 -> 构建 -> 重建项目
- 使缓存无效并重新启动 IDE:文件 -> 使缓存无效/重新启动
推荐阅读
- javascript - Momentjs 显示 isValid true 并且控制台记录正确的日期并闪烁正确的 .fromNow() 但很快更改为无效日期
- ios - WKWebView 中的用户名/密码认证
- vue.js - 使用 moment.js 在日期和时间之间添加空格
- arrays - 我如何在 Angular 7 中通过 ngx-translate 传递一个 html 属性的数组?
- sql - SQL Server 2008 每月每一天的考勤报告
- primefaces - 如何在 Primefaces 中禁用 p:growl?
- twitter-bootstrap - 使用 Datatable 切换到其他页面时缺少 Bootstrap 工具提示功能
- python - Sorl-Thumbnail : 只清除一张图片的缓存?
- reactjs - 反应:在渲染()之后和孩子的构造函数()之前的函数调用
- scala - 查找两个数据框中的共同行并标记第一个数据框中的共同行