简体   繁体   English

为什么在 flutter 应用程序上访问 firebase 时,Windows Android Studio Emulator 会突然变慢?

[英]Why would the Windows Android Studio Emulator suddenly become slow when accessing firebase on a flutter app?

I am testing a flutter app in the emulator in Android Studio.我正在 Android Studio 的模拟器中测试 flutter 应用程序。 The app and emulator had no issues a few days ago.该应用程序和模拟器几天前没有问题。 Suddenly, the app is painfully slow in a couple of areas:突然,该应用程序在几个方面变得非常缓慢:

  • The emulator no longer auto-boots the app.模拟器不再自动启动应用程序。 After Installing build/app/outputs/flutter-apk/app.apk... , nothing happens. Installing build/app/outputs/flutter-apk/app.apk...后,没有任何反应。 But the app is installed, and if the app is run manually, the debugger starts logging.但是应用程序已安装,如果应用程序是手动运行的,调试器会开始记录。
  • On initial load where the user logs in to firebase auth, or when already logged in and the app goes through that verification.在用户登录到 firebase 身份验证的初始加载时,或者当已经登录并且应用程序通过该验证时。 This takes about 5-10 minutes on an emulator, and about two seconds on a physical device (and was previously this fast on the emulator).这在模拟器上大约需要 5-10 分钟,在物理设备上大约需要两秒钟(之前在模拟器上速度如此之快)。
  • Occasionally firestore realtime updates don't happen, but are usually very slow有时不会发生 firestore 实时更新,但通常非常慢

A few troubleshooting notes:一些故障排除说明:

  • Emulator itself does not appear slow (ie no visible lag, and loading spinner is regular speed)模拟器本身并不显得慢(即没有明显的滞后,加载微调器是正常速度)
  • I have fully uninstalled Android Studio and reinstalled.我已经完全卸载 Android Studio 并重新安装。
  • System has 8 core CPU, 64GB RAM, modern GPU, SSD系统有 8 核 CPU,64GB RAM,现代 GPU,SSD
  • Emulator device is allocated 8GB RAM, 512MB heap, 3GB local storage仿真器设备分配有 8GB RAM、512MB 堆、3GB 本地存储
  • Android studio and plugins are latest version Android 工作室和插件都是最新版本
  • Emulator.network speed is set to full Emulator.network速度设置为full
  • This issue occurs on Windows. It runs normally on Mac Android Studio Emulator Windows出现此问题,在Mac Android Studio Emulator上运行正常

It's the issue with the recent versions of Android Emulator on Windows platform.这是 Windows 平台上最新版本的 Android 仿真器的问题。 Downgrade the version of Android Emulator to 31.2.9 .将 Android Emulator 的版本降级为31.2.9 You can download it from here .你可以从这里下载。

Procedure of manual installation of custom version of Android Emulator is given in the link above.手动安装 Android 仿真器自定义版本的步骤在上面的链接中给出。

This issue appears to be fixed with the latest stable Android Emulator release, v31.3.11-9058569 .此问题似乎已通过最新稳定的 Android 模拟器版本v31.3.11-9058569

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

相关问题 Flutter + firebase:配置app使用本地firebase模拟器 - Flutter + firebase: Configure app to use local firebase emulator Flutter Firebase 适用于真实设备 不适用于 Android 仿真器 - Flutter Firebase Works On Real Device Not On Android Emulator 无法在Flutter项目的Android模拟器中连接Firebase - Unable to connect Firebase in Android Emulator for Flutter Project Firebase 在 Android Studio 模拟器上不起作用 - Firebase doesn't work on Android Studio Emulator 使用 flutter (windows) 应用程序进行 firebase 匿名登录时出现 MissingPluginException 异常 - MissingPluginException exception when a firebase anonymous sign-in with flutter (windows) app Android Studio 模拟器 Firebase(登录/注册)不工作,但在设备上工作 - Android Studio emulator Firebase (login/register) not working but works on device Android 工作室 - 将 firebase 项目更改为 android 应用程序 - Android studio - Change firebase project for an android app Firebase Flutter 在模拟器中不起作用 - Firebase Flutter does not work in emulator Flutter Firebase 认证模拟器启用 - Flutter Firebase Authentication emulator enabling 当 object 添加到 firebase - Android Studio 时,应用程序崩溃与 GC - App crash with GC When an object added to firebase - Android Studio
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM