AVD 模拟器被杀死 - Mac - 没有任何效果 - [已解决] - 2021 [英] AVD emulator killed - Mac - nothing works - [solved] - 2021

查看:31
本文介绍了AVD 模拟器被杀死 - Mac - 没有任何效果 - [已解决] - 2021的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我花了一整天时间尝试在 stackoverflow 上的多个问题中找到的所有方法和数十个谷歌结果(简短摘要):

I've spent whole day trying all methods found in multiple questions here on stackoverflow and dozens of google results (short summary):

  • 重启电脑
  • 删除并重新创建 AVD
  • 将 AVD 图形更改为软件(在 AVD 管理器中和直接在文件中)
  • 在 SDK 管理器中重新安装模拟器(所有可能的方式 - 更新、删除和重新安装,启动 AVD 时按需重新安装)
  • 重新安装 HAXM
  • 重新安装 Android Studio
  • 在 SDK 管理器中检查所有 Android 版本
  • 从命令行启动 AVD(此方法对本文很重要)
  • 可能更多
  • ...这一切都以不同的顺序和组合多次

然后我在 YouTube 上的 (this) 视频下找到了此评论回复:

Then I've found this comment reply under (this) video on youtube:

找了 5 个小时后,我设法解决了这个问题.当我尝试从 android studio 运行时没有错误消息.但是,运行模拟器终端将打印错误消息,这将有很大帮助.从终端运行:/Users/hendrysetiadi/Library/Android/sdk/emulator/emulator 模拟器 -avd Pixel_4_API_29我的错误信息如下所示:模拟器:Android 模拟器版本 30.5.0.0 (build_id 7145572) (CL:N/A)dyld:库未加载:/System/Library/Frameworks/IOUSBHost.framework/Versions/A/IOUSBHost引用自:/Users/hendrysetiadi/Library/Android/sdk/emulator/qemu/darwin-x86_64/qemu-system-x86_64原因:找不到图片中止陷阱:6我设法从我朋友的笔记本电脑上获取了 IOUSBHost.framework,然后将其上传到谷歌驱动器(以 zip 格式)我按照这里的步骤https://apple.stackexchange.com/questions/300222/accidentally-deleted-a-system-framework-macos-screwed步骤是- 重启 mac 和 command+R 以显示恢复选项,选择 safari 图标以在恢复模式下启动 safari- 在safari中,打开我之前上传的google drive链接,然后将zip文件直接下载到/System/Library/Frameworks/(会自动解压)- 重新启动笔记本电脑.- 完毕
I managed to fix the issue after looking for it for 5 hours. There is no error message when I tried to run from the android studio. However, running the emulator the terminal will print the error message and this will help a lot. Run from terminal: /Users/hendrysetiadi/Library/Android/sdk/emulator/emulator emulator -avd Pixel_4_API_29 My error message is like below: emulator: Android emulator version 30.5.0.0 (build_id 7145572) (CL:N/A) dyld: Library not loaded: /System/Library/Frameworks/IOUSBHost.framework/Versions/A/IOUSBHost Referenced from: /Users/hendrysetiadi/Library/Android/sdk/emulator/qemu/darwin-x86_64/qemu-system-x86_64 Reason: image not found Abort trap: 6 I managed to get the IOUSBHost.framework from my friend laptop and then upload it to google drive (in zip format) I follow the steps in here https://apple.stackexchange.com/questions/300222/accidentally-deleted-a-system-framework-macos-screwed The steps are - restart mac and command+R to show recovery option, choose safari icon to launch safari in recovery mode - In safari, open the google drive link I have uploaded earlier, then download the zip file directly into /System/Library/Frameworks/ (it will automatically unzip) - restart the laptop. - Done

这与我使用命令行方法得到的错误完全相同.

That was exactly the same error I got using command line method.

问题是,我确实可以访问另一台运行 OSX 的计算机 - 在我的情况下是 Mojave.但是不知道os版本有没有那么重要.

The problem is, that I do net have access to another computer running OSX - Mojave in my case. But I don't know if the os version is that important.

我的问题是:是否有人有能力并愿意提供在 /System/Library/Frameworks/ 中找到的文件 IOUSBHost.framework 来自 OSX(最好是 Mojave) 并在此处发布链接?"最好是 zip,但我可以自己管理.

My question is: "Is anybody capable and willing to provide the file IOUSBHost.framework found in /System/Library/Frameworks/ from OSX (Mojave at best) and post the link here?" Preferably in zip, but I can manage this myself.

我将立即测试该方法,如果它有效,我将自己托管文件(以保持可用性并释放海报的资源)并在此处创建解决方案答案.

I will immediately test the method and if it will work I will host the file myself (to maintain availability and to free the poster`s resources) and create solution answer here.

谢谢

推荐答案

更新到 Android Emulator 30.5.4.0 后,不再需要该框架.Google 可能已经解决了这个问题.

After update to Android Emulator 30.5.4.0 the framework is no longer required. Google has probably fixed that.

经过进一步研究并感谢这里的评论,特别是 Don Pato 的回答,很明显在 Android 之后模拟器更新至 30.5.3.0 版,由于缺少框架,它开始在 OSX Mojave 及更早版本上显示给定错误.

After further research and thanks to comments here, and especially answer by Don Pato it became clear that after Android emulator update to version 30.5.3.0 it starts to show given error on OSX Mojave and older because of missing framework.

针对这种情况有 2 个明显的解决方案 + 这个:

There are 2 obvious solutions for this situation + this one:

  1. 更新操作系统
  2. 降级 Android 模拟器(以及 Android Studio 本身)
  3. 这个解决方案

由于某些其他软件兼容性,第一个解决方案可能无法使用,而第二个解决方案可能不切实际,因为较旧的模拟器最多可以运行 Android API 29.

The first solution can be unable due to some other software compatibility and the second can be impractical because older emulator is able to run Android API 29 max.

感谢所提到的 Youtube 评论的原作者 (Hendry Setiadi) 提供了所需文件 (他是这里的英雄),这个问题可以通过避免前面的 2 个选项来解决.我不得不改变他的一些步骤,因为由于磁盘空间不足",我无法在恢复模式下直接在 Safari 中下载文件.错误.

Thanks to original author (Hendry Setiadi) of mentioned Youtube comment who provided required file (he is the hero here), the problem can be solved avoiding 2 previous options. I had to change a little his steps, because I could not directly download the file in Safari in recovery mode due to "disk out of space" error.

解决过程:

  1. 从以下链接下载缺少的框架:https://www.dropbox.com/s/i9bzzw5sr0s7e81/IOUSBHost.framework.zip?dl=0
  2. Unizp
  3. 现在有必要将文件IOUSBHost.framework 放到/System/Library/Frameworks,这是系统只读目录.谁知道怎么做,可以停止阅读,直接去做.我是按照以下步骤完成的 - 其中一些可能是不必要的.
  4. 使用 Cmd+R 重新启动恢复,并在实用程序启动终端中使用 csrutil disable
  5. 禁用系统完整性保护
  6. 通过输入终端sudo mount -uw/
  7. 重新启动到系统并挂载系统可写
  8. 现在您可以复制文件 - 我是在 Finder 中完成的(需要 mac 用户密码)
  9. 不要忘记在恢复时通过 csrutil enable
  10. 再次打开 SIP
  1. Download missing framework from following link: https://www.dropbox.com/s/i9bzzw5sr0s7e81/IOUSBHost.framework.zip?dl=0
  2. Unizp
  3. Now it is necessary co get the file IOUSBHost.framework to /System/Library/Frameworks which is system read-only dir. Who knows how to do it, can stop reading and just do it. I did it by following steps - some of them might be unnecessary.
  4. Restart to recovery with Cmd+R and in Utilities start terminal to disable System Integrity Protection with csrutil disable
  5. Reboot to system and mount system writable by putting in terminal sudo mount -uw /
  6. Now you can copy the file - I did it in Finder (mac user password was required)
  7. Don't forget to turn SIP on again in recovery by csrutil enable

开始您的 AVD!

这篇关于AVD 模拟器被杀死 - Mac - 没有任何效果 - [已解决] - 2021的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆