AVD模拟器被杀死-Mac-无效-[已解决]-2021年 [英] AVD emulator killed - Mac - nothing works - [solved] - 2021

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

问题描述

我整天都在尝试关于stackoverflow和数十个Google结果(简短摘要)的多个问题中找到的所有方法:

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

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

 

寻找了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,然后将其上传到Google驱动器(以zip格式)我按照这里的步骤https://apple.stackexchange.com/questions/300222/accidentally-deleted-a-system-framework-macos-screwed步骤是-重新启动Mac和Command + R以显示恢复选项,选择safari图标以在恢复模式下启动safari-在safari中,打开我之前上传的google驱动器链接,然后将zip文件直接下载到/System/Library/Frameworks/中(它将自动解压缩)-重新启动笔记本电脑.- 完毕

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

问题是,我确实可以访问另一台运行OSX的计算机-就我而言就是Mojave.但是我不知道os版本是否那么重要.

我的问题是:有人有能力并且愿意提供OSX的/System/Library/Frameworks/中的文件 IOUSBHost.framework 吗?)并在此处发布链接?"最好采用zip格式,但我自己可以管理.

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

谢谢

解决方案

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


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

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

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

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

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

解决过程:

  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进行恢复

启动您的AVD!

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

  • Restart computer
  • Delete and recreate AVD
  • Change AVDs Graphic to Software (both in the AVD manager and directly in file)
  • Reinstall Emulator in SDK manager (all possible ways - update, delete and reinstall, reinstall on demand when starting AVD)
  • Reinstall HAXM
  • Reinstall Android studio
  • Check all Android versions in SDK manager
  • Start AVD from command line (this method is important for this post)
  • probably something more
  • ... and this everything several times in different order and combinations

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

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.

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.

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.

Thank you

解决方案

EDIT:

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


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.

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

  1. Update OS
  2. Downgrade Android emulator (along with Android studio itself)
  3. This solution

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.

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.

The solution process:

  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

Start your AVD!

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

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