简体   繁体   English

Expo / Android 模拟器“错误打开模拟器”

[英]Expo / Android Simulator 'Error opening simulator'

I just installed Android Studio, created and ran a virtual device and have run expo, which successfully established the web server.我刚刚安装了 Android Studio,创建并运行了一个虚拟设备并运行了 expo,成功建立了 web 服务器。

However, when I click on 'Run on Android Device/emulator' in the browser, I simply get en error message which says 'Error opening simulator.但是,当我在浏览器中单击“在 Android 设备/模拟器上运行”时,我只是收到一条错误消息,上面写着“打开模拟器时出错。 Check metro logs for details'.检查地铁日志以获取详细信息'。 There is no logged output on the screen or in the console.屏幕或控制台中没有记录 output。 在此处输入图像描述

After a few seconds, I get the following message from Android Studio:几秒钟后,我从 Android Studio 收到以下消息: 在此处输入图像描述

If I try to launch Android in the console by pressing 'a', I get the following error:如果我尝试通过按“a”在控制台中启动 Android,我会收到以下错误: 在此处输入图像描述

EDIT: I found there were 2 adb processes running in the task manager.编辑:我发现有 2 个 adb 进程在任务管理器中运行。 I killed both and restarted expo, which now shows a different error:我杀了两个并重新启动 expo,现在显示不同的错误: 在此处输入图像描述

Any idea on how I can resolve this please?关于如何解决这个问题的任何想法?

Thanks谢谢

So I found the solution myself.所以我自己找到了解决方案。

  1. I completely removed Android Studio (see here for windows: How to completely uninstall Android Studio from windows(v10)? )我完全删除了 Android Studio(有关 windows,请参见此处: 如何从 windows(v10) 完全卸载 Android Studio?
  2. Reinstalled Android Studio重装 Android Studio
  3. Started the Android Device Emulator启动 Android 设备模拟器
  4. Ran expo start冉世博开始
  5. Entered 'Tunnel Mode' via the browser (see screenshot below)通过浏览器进入“隧道模式”(见下面的截图)
  6. Clicked 'Run on Android Device'单击“在 Android 设备上运行”

and bingo it worked.和宾果它奏效了。 If you have trouble, be sure you kill all adb processes before you start the process and try again.如果遇到问题,请确保在启动进程之前杀死所有 adb 进程并重试。

在此处输入图片说明

I found a working solution on my system.我在我的系统上找到了一个可行的解决方案。

1- I deleted all of the emulators from android studio- 1- 我从 android studio 中删除了所有模拟器-

在此处输入图像描述

2- Then Tools --> SDK manager --> Android SDK and check the box in front of ' show package detail ' and Uncheck the box for Google APIs Intel x86... 2- 然后工具 --> SDK 管理器 --> Android SDK 并选中“显示 package 详细信息”前面的框并取消选中 Google APIs Intel x86 前面的框...

在此处输入图像描述

Then open your system's sdk path (Android SDK Location), (for example, my path is C:\Users\userName\AppData\Local\Android\Sdk ) open the folder and delete the folders inside the system image folder.然后打开你系统的 sdk 路径(Android SDK Location),(比如我的路径是C:\Users\userName\AppData\Local\Android\Sdk )打开文件夹,删除系统镜像文件夹里面的文件夹。

3- Now in android studio again, Tools --> SDK manager --> Android SDK, and check the box in front of ' show package detail '. 3- 现在再次进入 android 工作室,工具 --> SDK 经理 --> Android SDK,并选中“显示 package 详细信息”前面的框。 Look for Google APIs Intel x86...(check the box) under Android 12 (S), click apply to install again.在 Android 12 (S) 下寻找 Google APIs Intel x86...(打勾),点击应用重新安装。

4- Tools--> Device manager --> create Device. 4- 工具 --> 设备管理器 --> 创建设备。 Set up a new emulator device设置新的模拟器设备

connect it with Metro Bundler.将它与 Metro Bundler 连接起来。

Cheers, it worked for me without uninstalling the entire android studio.干杯,它对我有用,而无需卸载整个 android 工作室。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Expo - 图标 position 在 Android 模拟器中不正确 - Expo - Icon position is incorrect in Android Simulator 出现 ['Unhandled Promise Rejection: Error: No matching activity!] 在 Expo913F075AEZ4E13B3F9Dandroid 模拟器上使用 WebBrowser 时出错 - Getting ['Unhandled Promise Rejection: Error: No matching activity!] error when using WebBrowser on android simulator in Expo Go Expo react-native app with firebase phone authentication works on web, error on ios simulator and crashes with no warning on Android - Expo react-native app with firebase phone authentication works on web, error on ios simulator and crashes with no warning on Android MobileFirst上的Android模拟器的shouldStartProvisioning错误 - shouldStartProvisioning error for android simulator on mobilefirst IOS 和 Android 模拟器无法在浏览器中加载 expo 项目或 Metro 捆绑器 - IOS and Android simulator cannot load expo project or Metro bundler in browser Android 模拟器上的 Expo 无法运行,出现问题 - Expo on Android simulator could not run, Something went wrong “不幸的是,myapp已停止” android模拟器错误 - “unfortunately, myapp has stopped” android simulator error 应用程式可在模拟器上运作,但无法在Android上运作 - app works on simulator but not on android 模拟器上的Android文件选择器 - Android File Chooser on Simulator 适用于iOS / Android的模拟器 - Simulator for iOS/Android
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM