我花了一整天时间尝试在 stackoverflow 上的多个问题中找到的所有方法和数十个谷歌结果(简短摘要):
然后我在 youtube 上的 (this) 视频下找到了这个评论回复:
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
这与我使用命令行方法得到的错误完全相同。
问题是,我确实可以访问另一台运行 OSX 的计算机 - 在我的情况下是 Mojave。但我不知道操作系统版本是否那么重要。
我的问题是:“是否有人有能力并愿意提供在 /System/Library/Frameworks/ 中找到的文件 IOUSBHost.framework 来自 OSX(最好是 Mojave)并在这里发布链接?”最好是 zip,但我可以自己管理。
我将立即测试该方法,如果它有效,我将自己托管文件(以保持可用性并释放海报的资源)并在此处创建解决方案答案。
谢谢
答案 0 :(得分:9)
编辑:
更新到 Android Emulator 30.5.4.0 后,不再需要该框架。 Google 可能已经解决了这个问题。
经过进一步研究并感谢此处的评论,特别是 Don Pato 的回答,很明显,在 Android 模拟器更新到版本 30.5.3.0 后,由于缺少框架,它开始在 OSX Mojave 及更早版本上显示给定错误。
对于这种情况有 2 个明显的解决方案 + 这个:
由于某些其他软件兼容性,第一个解决方案可能无法使用,而第二个解决方案可能不切实际,因为较旧的模拟器最多可以运行 Android API 29。
感谢提到的 Youtube 评论的原作者 (Hendry Setiadi) 提供了所需的文件(他是这里的主角),这个问题可以通过避免前面的 2 个选项来解决。我不得不稍微改变他的步骤,因为由于“磁盘空间不足”错误,我无法在恢复模式下直接在 Safari 中下载文件。
解决过程:
csrutil disable
禁用系统完整性保护sudo mount -uw /
重新启动到系统并挂载系统可写csrutil enable
之前在恢复时再次打开 SIP 开始您的 AVD!
答案 1 :(得分:2)
我遇到了和你一样的错误。建议的解决方案没有任何效果。我已经尝试了你所做的一切。 到目前为止,似乎唯一的解决方案是至少将我们的 Mac 升级到 Catalina……或者降级所有内容……这似乎不是最简单的方法。
<块引用>在 macOS 10.15 Catalina 中,Apple 引入了一个新框架 在用户模式下访问 USB 设备,IOUSBHost 框架。
你可以在这里阅读更多:
希望这也能给你带来一些启发;)
答案 2 :(得分:2)
Google 正在处理此错误。模拟器的下一个版本将不依赖于该框架。这里有 36 个测试版:
答案 3 :(得分:1)
我使用的是 High Sierra OSx 10.13.6。
自从模拟器升级到 3.5.3.0 后,我在命令行上收到相同的错误消息
~/Library/Android/sdk/emulator/emulator -avd Pixel_XL_API_30 模拟器:Android 模拟器版本 30.5.3.0 (build_id 7196367) (CL:N/A) dyld:库未加载:/System/Library/Frameworks/IOUSBHost.framework/Versions/A/IOUSBHost 引用自:/Users/user/Library/Android/sdk/emulator/qemu/darwin-x86_64/qemu-system-x86_64 原因:找不到图片 中止陷阱:6
将尝试下载给定的 zip 文件并尝试修复。谢谢杰夫。
答案 4 :(得分:0)
我也遇到过这个问题。将我的 Android Studio 更新为 4.1.3
后,模拟器停止运行。
我尽一切可能解决这个问题。发现对于少数人来说,将他们的 MacOS 升级到 big sur 修复了它。我下载了 big-sur
,但在安装时,它要求从设备中释放 25GB,这是不可能的,因此也无法安装 big-sur。
最终,在更新到 Android Emulator 30.5.4.0
后,它解决了这个问题。不需要做任何其他事情。谷歌似乎在最新的 Android 模拟器版本中修复了它。