日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > windows >内容正文

windows

Flutter Dart 安装在window系统

發布時間:2025/5/22 windows 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Flutter Dart 安装在window系统 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

一、系統環境

flutter最低要求

1,windows7 SP1 64位版本以上,我的系統就是windows 7 sp1 64bit

2,git for windows ,沒有安裝的需要到這里下載?并安裝

3,powershell 5.0及以上,這個據說只有windows10和2016版windows server滿足要求

window7 sp1以及自帶Powershell,但是版本較低,我的系統中版本居然是2.0

啟動:系統左下角-開始-點擊搜索框-輸入powershell-回車鍵 在powershell中輸入 $PSVersionTable 然后回車,查看其中的PSVersion一行Windows PowerShell 版權所有 (C) 2009 Microsoft Corporation。保留所有權利。PS C:\Users\gzg> $PSVersionTableName Value ---- ----- CLRVersion 2.0.50727.8793 BuildVersion 6.1.7601.17514 PSVersion 2.0 WSManStackVersion 2.0 PSCompatibleVersions {1.0, 2.0} SerializationVersion 1.1.0.1 PSRemotingProtocolVersion 2.1PS C:\Users\gzg> 如何查看PowerShell版本

由于PS沒有單獨的發行包,只能下載WMF5.1的發行包

下載后展開,包含如下兩個文件,右鍵點擊Install-WMF5.1.ps1,選擇用powershell運行安裝,過程不贅述。

4,安裝配置好android SDK,并建立一個模擬器

5,Android Studio,如果沒有請安裝http://www.androiddevtools.cn/。

二、下載安裝flutter sdk

1,進入預存放flutter目錄的父目錄中,從github克隆flutter beta版

git clone -b beta https://github.com/flutter/flutter.git

2,設置環境變量

1)將? *\flutter\bin目錄加入到環境變量path中

2)添加ANDROID_HOME環境變量,指向android SDK所在目錄

3, 設置國內鏡像代理,然后執行flutter doctor

打開dos窗口,設置國內鏡像

set PUB_HOSTED_URL=https://pub.flutter-io.cnset FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn

備注:或者也可以直接添加系統變量,以備以后升級安裝方便。

4,進行下一步之前,首先關閉殺毒殺木馬程序,例如360之類,否則“flutter\bin\cache\artifacts\engine\android-arm64-release\windows-x64\gen_snapshot.exe” 會被認成木馬,造成運行失敗!

我這里的報錯信息如下:

K:\Android\flutter>flutter doctor Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!Oops; flutter has exited unexpectedly. Sending crash report to Google.

或者,給目錄“flutter\bin”添加到信任白名單。如果還有問題,看一看flutter目錄下的“flutter_##.log”文件查找原因,然后在解決即可。

5,運行flutter設置命令

flutter doctor

flutter會檢測flutter SDK安裝情況,然后下載dart SDK和其他依賴項目,由于網絡問題運行時間較長,期間不免發生失敗情況,需要多運行幾次。

PS C:\Users\gzg> flutter doctor Downloading android-arm-release/windows-x64 tools... Download failed -- attempting retry 1 in 1 second... Download failed -- attempting retry 2 in 2 seconds... Download failed -- attempting retry 3 in 4 seconds... Download failed -- attempting retry 4 in 8 seconds... Download failed -- attempting retry 5 in 16 seconds... Download failed -- attempting retry 6 in 32 seconds... Download failed -- attempting retry 7 in 64 seconds... Download failed -- attempting retry 8 in 64 seconds... 365.2s Downloading android-arm64-profile/windows-x64 tools... 8.2s Downloading android-arm64-release/windows-x64 tools... 7.6s Downloading android-x86 tools... Download failed -- attempting retry 1 in 1 second... Download failed -- attempting retry 2 in 2 seconds... 142.8s Downloading android-x64 tools... 53.4s Downloading android-arm tools... 24.4s Downloading android-arm-profile tools...Oops; flutter has exited unexpectedly. Sending crash report to Google. Failed to send crash report due to a network error: SocketException: OS Error: ????·?ˉè?…?—??—?é—′?·2??° , errno = 121, address = clients2.google.com, port = 60527 Crash report written to C:\Users\gzg\flutter_03.log; please let us know at https://github.com/flutter/flutter/issues. PS C:\Users\gzg> flutter doctor Downloading android-arm-profile tools... Download failed -- attempting retry 1 in 1 second... Download failed -- attempting retry 2 in 2 seconds... Download failed -- attempting retry 3 in 4 seconds... Download failed -- attempting retry 4 in 8 seconds... Download failed -- attempting retry 5 in 16 seconds... Download failed -- attempting retry 6 in 32 seconds... 254.5s Downloading android-arm-release tools... Download failed -- attempting retry 1 in 1 second... 61.0s Downloading android-arm64 tools... 27.6s Downloading android-arm64-profile tools... Download failed -- attempting retry 1 in 1 second... 71.0s Downloading android-arm64-release tools... Download failed -- attempting retry 1 in 1 second... Download failed -- attempting retry 2 in 2 seconds... Download failed -- attempting retry 3 in 4 seconds... Download failed -- attempting retry 4 in 8 seconds... Download failed -- attempting retry 5 in 16 seconds...

6,最后,flutter doctor命令會給出環境檢測結果,如果有些項目有問題,則按照其中說明修正,例如,我這里有兩項有問題:

Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel unknown, v0.0.0-unknown, on Microsoft Windows [Version 6.1.7601], locale zh-CN) [!] Android toolchain - develop for Android devices (Android SDK 28.0.3)! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses [√] Android Studio (version 3.2) [√] IntelliJ IDEA Community Edition (version 2018.2) [!] Connected device! No devices available! Doctor found issues in 2 categories.

?第二項問題依照藍色提示操作即可解決。最后一項虛擬機,建立一個虛擬機并啟動,再次運行檢測,沒問題了!

C:\Users\gzg>flutter doctor Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel unknown, v0.0.0-unknown, on Microsoft Windows [Version 6.1.7601], locale zh-CN) [√] Android toolchain - develop for Android devices (Android SDK 28.0.3) [√] Android Studio (version 3.2) [√] IntelliJ IDEA Community Edition (version 2018.2) [√] Connected device (1 available)? No issues found!

三、開始flutter之旅

在android studio中建立flutter項目

菜單“File--New--New Flutter Project...”,第一步選擇“Flutter Application”,第二部輸入項目名稱,注意一定要選中下面的選項“create project offline”,否則在我的網絡環境下就進行不下去了。

?

轉載于:https://www.cnblogs.com/dajianshi/p/9894142.html

總結

以上是生活随笔為你收集整理的Flutter Dart 安装在window系统的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。