[英]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.