【问题标题】:flutter upgrade downloads new Dart SDK every time after 'flutter channel <channel-name>'每次“flutter channel <channel-name>”之后,flutter upgrade 都会下载新的 Dart SDK
【发布时间】:2020-09-08 15:41:10
【问题描述】:

我需要经常在stablemaster 频道之间切换,以使用一些新功能或能够运行一些项目(如flutter/gallery)。

并且每次我运行命令flutter channel master/stable 后跟flutter upgrade 时,似乎正在下载一个新的 Dart SDK 以及许多其他内容(参见下面的输出),所以,切换来不及了,还要等,连频道之间的时间都是秒!

> flutter channel stable
Switching to flutter channel 'stable'...
git: Your branch is up to date with 'origin/stable'.
git: Switched to branch 'stable'
Successfully switched to flutter channel 'stable'.
To ensure that you're on the latest build from this channel, run 'flutter upgrade'
PS D:\DevLib\Flutter\flutter_course> flutter doctor        
Checking Dart SDK version...
Downloading Dart SDK from Flutter engine 6bc433c6b6b5b98dcf4cc11aff31cdee90849f32...
Unzipping Dart SDK...
Building flutter tool...
Running pub upgrade...

  ╔════════════════════════════════════════════════════════════════════════════╗
  ║                 Welcome to Flutter! - https://flutter.dev                  ║
  ║                                                                            ║
  ║ The Flutter tool uses Google Analytics to anonymously report feature usage ║
  ║ statistics and basic crash reports. This data is used to help improve      ║
  ║ Flutter tools over time.                                                   ║
  ║                                                                            ║
  ║ Flutter tool analytics are not sent on the very first run. To disable      ║
  ║ reporting, type 'flutter config --no-analytics'. To display the current    ║
  ║ setting, type 'flutter config'. If you opt out of analytics, an opt-out    ║
  ║ event will be sent, and then no further information will be sent by the    ║
  ║ Flutter tool.                                                              ║
  ║                                                                            ║
  ║ By downloading the Flutter SDK, you agree to the Google Terms of Service.  ║
  ║ Note: The Google Privacy Policy describes how data is handled in this      ║
  ║ service.                                                                   ║
  ║                                                                            ║
  ║ Moreover, Flutter includes the Dart SDK, which may send usage metrics and  ║
  ║ crash reports to Google.                                                   ║
  ║                                                                            ║
  ║ Read about data we send with crash reports:                                ║
  ║ https://flutter.dev/docs/reference/crash-reporting                         ║
  ║                                                                            ║
  ║ See Google's privacy policy:                                               ║
  ║ https://policies.google.com/privacy                                        ║
  ╚════════════════════════════════════════════════════════════════════════════╝


Downloading package sky_engine...                                   1.6s
Downloading flutter_patched_sdk tools...                            6.4s
Downloading flutter_patched_sdk_product tools...                    6.4s
Downloading windows-x64 tools...                                   14.9s
Downloading windows-x64/font-subset tools...                        2.3s
Downloading android-arm-release/windows-x64 tools...                1.5s
Downloading android-arm64-profile/windows-x64 tools...              1.9s
Downloading android-arm64-release/windows-x64 tools...              1.5s
Downloading android-x64-profile/windows-x64 tools...                1.9s
Downloading android-x64-release/windows-x64 tools...                1.7s
Doctor summary (to see all details, run flutter doctor -v):

【问题讨论】:

  • 我没有得到这个问题...如果有的话。通道之间涉及很多东西,需要针对不同平台进行编译,这就是原因。
  • 切换 stable->master->stable(在几分之一秒内)应该下载 Dart SDK 和所有二进制文件对您来说是否直观(查看最后几行和最后的时间它)一遍又一遍?
  • 我真的不认为这是直观的......但不是 StackOverFlow 的主题。也许 Reddit 可以更好地处理类似的事情,甚至可以在 Github 上进行报告,并从 Google 团队那里获得反馈。
  • MacOS (Linux) 的简单解决方案stackoverflow.com/a/66224133/12118935

标签: flutter


【解决方案1】:

是的,频道切换afaik基本上没有缓存。

我建议你看看this article,以及this plugin

【讨论】:

    猜你喜欢
    • 2020-08-16
    • 2021-04-02
    • 2021-08-30
    • 2020-08-22
    • 1970-01-01
    • 1970-01-01
    • 2019-09-05
    • 2020-11-12
    • 2022-11-11
    相关资源
    最近更新 更多