简体   繁体   English

如何在不花这么长时间的情况下运行 flutter 应用程序?

[英]how to run flutter app without taking so long?

well I'm new to flutter. I see that everytime I try to run the application it takes so long to update and show me the result, Although I'm using an emulator.好吧,我是 flutter 的新手。我发现每次尝试运行该应用程序时,更新和显示结果都需要很长时间,尽管我使用的是模拟器。 I guess it is because of GRADLE. is there any way to minimize the wasted time?我猜是因为GRADLE。有什么办法可以减少浪费的时间吗?

Usually, the first time you run the application with flutter run , it takes a while to build the application.通常,第一次使用flutter run应用程序时,构建应用程序需要一段时间。

From there, you can see your changes if you press lowercase r (hot reload) instantly.从那里,如果您立即按小写字母r (热重载),您可以看到您的更改。 If you press uppercase R (hot restart), the application will restart instantly as well.如果按大写字母R (热重启),应用程序也会立即重启。

An actual rerun with flutter run is rarely needed, only if you add new packages to your app.很少需要实际重新运行flutter run ,只有在您将新包添加到您的应用程序时才需要。

Based on my personal experience, Flutter is rather demanding on your machine, make sure you have the right hardware.根据我的个人经验,Flutter 对你的机器要求很高,确保你有合适的硬件。

I had a 8 gb of RAM and mechanical hard disk drive (HDD).我有一个 8 GB 的 RAM 和机械硬盘驱动器 (HDD)。 The Gradle build would 15+ minutes. Gradle 构建需要 15 分钟以上。

I replaced my HDD with a Solid State Drive (SSD).我用 Solid State 驱动器 (SSD) 替换了我的 HDD。 And added an additional 8gb of RAM.并添加了额外的 8GB RAM。 Now the gradle build takes around 1 min.现在 gradle 构建大约需要 1 分钟。

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

相关问题 为什么Robolectric的第一次测试需要这么长时间? - Why is does the first test run with Robolectric taking so long? 如何在不覆盖现有应用程序的情况下运行 flutter 项目的副本? - How to run a copy of flutter project without overwriting the existing app? 如何在不使用应用名称的情况下检查它是否可用? - How to check if an app name is available without taking it? 为什么我的构建需要这么长时间? - Why is my build taking so long? AutoCompleteTextView需要很长时间才能重新加载联系人 - AutoCompleteTextView taking so long to reload contacts 为什么Gradle需要这么长时间才能建造? - Why is Gradle taking so long to build? 我如何在android中单击一个按钮就运行一个长代码而不会导致应用崩溃? - How can i run a long code on single button click in android without app crash? 如何在真实设备上运行 flutter 应用程序,而无需每次都在手机上安装 sdk - How to run flutter app on a real device without having to install the sdk on your phone evrytime 如何在没有互联网访问的情况下运行 flutter 应用程序 - how to run flutter application without internet access Flutter Execute Method 这么长时间按下按钮 - Flutter Execute Method so long the button pressed
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM