真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

Flutter入門(mén)-創(chuàng)新互聯(lián)

Dart語(yǔ)言中文網(wǎng)?http://dart.goodev.org/

創(chuàng)新互聯(lián)建站專業(yè)提供成都主機(jī)托管四川主機(jī)托管成都服務(wù)器托管四川服務(wù)器托管,支持按月付款!我們的承諾:貴族品質(zhì)、平民價(jià)格,機(jī)房位于中國(guó)電信/網(wǎng)通/移動(dòng)機(jī)房,服務(wù)器托管服務(wù)有保障!

Flutter官網(wǎng)?https://flutter.dev/

Flutter中文網(wǎng)? https://flutterchina.club/

一、windows環(huán)境搭建

  • 配置鏡像(加快FlutterSDK下載)? ? ? ?

官方寫(xiě)的這個(gè)export是用在linux上的

export?PUB_HOSTED_URL=https://pub.flutter-io.cn
export?FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn

window上要將export換成set,但是去環(huán)境變量界面查看竟然沒(méi)有

Flutter入門(mén)

cmd 輸入set,會(huì)查看所有的環(huán)境變量,發(fā)現(xiàn)有設(shè)置的環(huán)境變量。

  • 下載FlutterSDK

    下載FlutterSDK,在path里配置“flutter\bin”的環(huán)境變量。

    執(zhí)行flutter doctor,下載FlutterSDK相關(guān)的依賴。

??

  • Android Studio上安裝Flutter和Dart插件

二、創(chuàng)建Flutter項(xiàng)目

  • 創(chuàng)建項(xiàng)目

Flutter入門(mén)

這里的flutter sdk path就是flutter文件夾位置

Flutter入門(mén)

*****和創(chuàng)建Android APP項(xiàng)目對(duì)比可發(fā)現(xiàn),沒(méi)有了minSdk、targetSdk這些個(gè)選項(xiàng)。(意思)

  • 運(yùn)行項(xiàng)目

首次運(yùn)行,可能會(huì)有以下錯(cuò)誤:

Launching?lib\main.dart?on?SM?N9009?in?debug?mode...
Initializing?gradle...
Finished?with?error:?ProcessException:?Process?"F:\Work\Flutter\flutter_app\android\gradlew.bat"?exited?abnormally:
Downloading?https://services.gradle.org/distributions/gradle-4.10.2-all.zip
..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

Exception?in?thread?"main"?javax.net.ssl.SSLException:?Connection?has?been?shutdown:?javax.net.ssl.SSLException:?java.net.SocketException:?Connection?reset
	at?sun.security.ssl.SSLSocketImpl.checkEOF(SSLSocketImpl.java:1551)
	at?sun.security.ssl.AppInputStream.available(AppInputStream.java:60)
	at?java.io.BufferedInputStream.available(BufferedInputStream.java:410)
	at?sun.net.www.MeteredStream.available(MeteredStream.java:170)
	at?sun.net.www.http.KeepAliveStream.close(KeepAliveStream.java:85)
	at?java.io.FilterInputStream.close(FilterInputStream.java:181)
	at?sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.close(HttpURLConnection.java:3448)
	at?org.gradle.wrapper.Download.downloadInternal(Download.java:77)
	at?org.gradle.wrapper.Download.download(Download.java:44)
	at?org.gradle.wrapper.Install$1.call(Install.java:61)
	at?org.gradle.wrapper.Install$1.call(Install.java:48)
	at?org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
	at?org.gradle.wrapper.Install.createDist(Install.java:48)
	at?org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
	at?org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Caused?by:?javax.net.ssl.SSLException:?java.net.SocketException:?Connection?reset
	at?sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
	at?sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1959)
	at?sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1916)
	at?sun.security.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1880)
	at?sun.security.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1825)
	at?sun.security.ssl.AppInputStream.read(AppInputStream.java:116)
	at?java.io.BufferedInputStream.read1(BufferedInputStream.java:284)
	at?java.io.BufferedInputStream.read(BufferedInputStream.java:345)
	at?sun.net.www.MeteredStream.read(MeteredStream.java:134)
	at?java.io.FilterInputStream.read(FilterInputStream.java:133)
	at?sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3375)
	at?sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3368)
	at?org.gradle.wrapper.Download.downloadInternal(Download.java:62)
	...?7?more
Caused?by:?java.net.SocketException:?Connection?reset
	at?java.net.SocketInputStream.read(SocketInputStream.java:210)
	at?java.net.SocketInputStream.read(SocketInputStream.java:141)
	at?sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
	at?sun.security.ssl.InputRecord.readV3Record(InputRecord.java:593)
	at?sun.security.ssl.InputRecord.read(InputRecord.java:532)
	at?sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983)
	at?sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:940)
	at?sun.security.ssl.AppInputStream.read(AppInputStream.java:105)
	...?14?more
??Command:?F:\Work\Flutter\flutter_app\android\gradlew.bat?-v

這個(gè)是在下載gradle,網(wǎng)絡(luò)不好的原因。如果網(wǎng)絡(luò)好了,run會(huì)自動(dòng)下載gradle,run成功之后,控制臺(tái)會(huì)顯示:

????Launching?lib\main.dart?on?SM?N9009?in?debug?mode...
Initializing?gradle...
Resolving?dependencies...
[{"event":"app.progress","params":{"appId":"d62136c6-30c8-4426-8e6e-e1ec5bdf918e","id":"2","progressId":null,"message":"Running?Gradle?task?'assembleDebug'..."}}]Running?Gradle?task?'assembleDebug'...

Built?build\app\outputs\apk\debug\app-debug.apk.
Installing?build\app\outputs\apk\app.apk...
[{"event":"app.progress","params":{"appId":"d62136c6-30c8-4426-8e6e-e1ec5bdf918e","id":"4","progressId":null,"message":"Syncing?files?to?device?SM?N9009..."}}]Syncing?files?to?device?SM?N9009...

趕緊體驗(yàn)了一把“熱重載”特性,實(shí)在是非常爽?。。?/p>

?另外,通過(guò)控制臺(tái)日志可以發(fā)現(xiàn):

Launching?lib\main.dart?on?SM?N9009?in?debug?mode...
Initializing?gradle...
Resolving?dependencies...
Running?Gradle?task?'assembleDebug'...
Built?build\app\outputs\apk\debug\app-debug.apk.
Installing?build\app\outputs\apk\app.apk...
Syncing?files?to?device?SM?N9009...

項(xiàng)目第一次run的時(shí)候,也會(huì)生成apk文件。

  • 打開(kāi)項(xiàng)目出現(xiàn)一直提示加載的問(wèn)題? ??

? ?Android Studio使用flutter upgrade等時(shí)提示waiting for another flutter command to release the startup lock

解決辦法:

????先打開(kāi)任務(wù)管理器,結(jié)束掉所有dart.exe。然后打開(kāi)你的flutter安裝文件夾,找到\bin\cache中的lockfile文件刪除。之后重啟Android?Studio。

???

  • 依賴package

****更新yaml文件之后,點(diǎn)擊Packages get,即可將包下載下來(lái)。

Flutter入門(mén)

然后在dart里import

****?yaml文件,點(diǎn)擊Get dependencies,會(huì)報(bào)下面的錯(cuò)誤,不用管就行。

Working?dir:?F:\Work\Flutter\startup_namer
G:\Android\flutter_windows_v1.7.8+hotfix.4-stable\flutter\bin\cache\dart-sdk\bin\pub.bat?upgrade
Resolving?dependencies...
Because?startup_namer?depends?on?flutter_test?any?from?sdk?which?doesn't?exist?(the?Flutter?SDK?is?not?available),?version?solving?failed.

Flutter?users?should?run?`flutter?pub?get`?instead?of?`pub?get`.
Process?finished?with?exit?code?69

? ??

?????

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。


文章名稱:Flutter入門(mén)-創(chuàng)新互聯(lián)
文章地址:http://weahome.cn/article/ggcgi.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部