性久久久久久,性色av浪潮av色欲av,国产日韩精品在线观看,亚洲色成人网一二三区

歡迎您光臨深圳塔燈網(wǎng)絡(luò)科技有限公司!
電話圖標(biāo) 余先生:13699882642

網(wǎng)站百科

為您解碼網(wǎng)站建設(shè)的點點滴滴

01 - Flutter環(huán)境搭建

發(fā)表日期:2018-12 文章編輯:小燈 瀏覽次數(shù):7343

[TOC]
寫在最前面,想玩flutter最好有科學(xué)上網(wǎng)的梯子,否則被墻的整個人都暴躁了

下載SDK

在目標(biāo)目錄使用git拉取flutter的sdk

# 移動到目標(biāo)目錄 cd ${HOME}/env # 拉取sdk git clone https://github.com/flutter/flutter.git 

環(huán)境變量配置

  • 需要提前配置好安卓開發(fā)環(huán)境,可以提前配置好jdk,android sdk等環(huán)境變量

  • 需要配置flutter sdk的環(huán)境變量

  • 需要配置flutter的鏡像地址

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

.bash_profile的參考配置

# jdk begin JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home # jdk end # android sdk begin ANDROID_HOME=/Users/rexih/Library/Android/sdk ADB_HOME=/Users/rexih/Library/Android/sdk/platform-tools # android sdk end #android ndk begin NDK_HOME=/Users/rexih/Library/Android/sdk/ndk-bundle CMAKE_HOME=/Users/rexih/Library/Android/sdk/cmake/3.6.4111459 #android ndk end # flutter begin FLUTTER_HOME=/Users/rexih/env/flutter PUB_HOSTED_URL=https://pub.flutter-io.cn FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn # flutter end PATH=$FLUTTER_HOME/bin:$FLUTTER_HOME:$CMAKE_HOME/bin:$ANDROID_HOME/:$ANDROID_HOME/tools:$ADB_HOME:$NDK_HOME:$JAVA_HOME/bin:$PATH:. CLASSPATH=JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar:. export JAVA_HOME export ANDROID_HOME export ADB_HOME export NDK_HOME export CMAKE_HOME export PATH export CLASSPATH export FLUTTER_HOME export PUB_HOSTED_URL export FLUTTER_STORAGE_BASE_URL 

Android Studio插件安裝

打開as(本文使用的是3.2.1 stable)的plugin,下載插件Flutter,會自動下載插件Dart,確保兩個插件勾選,重啟as

環(huán)境診斷與修復(fù)

flutter提供doctor指令幫助用戶診斷開發(fā)環(huán)境是否可用,根據(jù)命令行里的診斷結(jié)果逐步修復(fù)即可

  • 第一次運行會自動下載Dart SDK

    Downloading Dart SDK from Flutter engine# ... Building flutter tool... # ... Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source! # ... Doctor summary (to see all details, run flutter doctor -v): # ... 
  • 診斷結(jié)果會告知去設(shè)置Android SDK的環(huán)境變量

  • 診斷結(jié)果會告知運行flutter doctor --android-licenses通過licenses以使用

    [!] Android toolchain - develop for Android devices (Android SDK version 28.0.3) ! Some Android licenses not accepted.To resolve this, run: flutter doctor --android-licenses 
  • 診斷結(jié)果會告知安裝AS插

    [!] Android Studio (version 3.2) ? Flutter plugin not installed; this adds Flutter specific functionality. ? Dart plugin not installed; this adds Dart specific functionality. 
  • 診斷結(jié)果會告知運行設(shè)備情況

    [!] Connected device ! No devices available 
  • 診斷結(jié)果會告知idea和iOS的開發(fā)環(huán)境的可用性

設(shè)置gradle及代碼倉庫地址

  • 國內(nèi)被墻的很嚴(yán)重。gradle下載太慢了。建議先下載好gradle的對應(yīng)版本,放置到本地gradle倉庫里,以加快構(gòu)建速度。(移動寬帶直接下載也挺慢的)

  • 手動下載gradle對應(yīng)版本。例如下載gradle 4.10.2 地址:https://downloads.gradle.org/distributions/gradle-4.10.2-all.zip,下載完成后放到${HOME}/.gradle/wrapper/dists/gradle-4.10.2-all/9fahxiiecdb76a5g3aw9oi8rv,解壓,修改文件鎖gradle-4.10.2-all.zip.ok

  • 使用鏡像替代flutter的腳本倉庫。找到flutter sdk的根目錄,打開packages/flutter_tools/gradle/flutter.gradle,修改倉庫地址

    buildscript { repositories { maven { url "https://maven.aliyun.com/repository/google" } maven { url "https://maven.aliyun.com/repository/jcenter" } maven { url "http://maven.aliyun.com/nexus/content/groups/public" } // google() // jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.2.1' } } 

    ?

創(chuàng)建Flutter項目

  • 配置好開發(fā)環(huán)境后,AS新建項目時會增加新的創(chuàng)建選項Start a new Flutter project

  • 設(shè)置項目名稱時,必須遵守其命名規(guī)范,小寫加_下劃線,否則會提示

    Invalid project name: 'T' - must be a valid Dart package name (lower_case_with_underscores) 
  • 點擊播放鍵編譯運行項目

熱重載

修改后,不點擊播放鍵,直接ctrl+s保存一下源文件,發(fā)現(xiàn)設(shè)備上直接同步了修改

  1. 要查看您的更改, 只需調(diào)用 Save All (cmd-s / ctrl-s), 或點擊 熱重載按鈕 (帶有閃電??圖標(biāo)的按鈕).

flutter相關(guān)指令

查看連接設(shè)備

flutter devices1 connected device:Android SDK built for x86 ? emulator-5554 ? android-x86 ? Android 9 (API 28) (emulator) 

切換flutter到Stable版本

# 查看可用版本 flutter channel # 切換到stable版本 flutter channel stable # 切換版本后再次調(diào)用flutter指令會重新配置開發(fā)環(huán)境 flutter 

其他

離線下載flutter和dart插件

9212-flutter
6351-dart

卡在Creating Flutter Project

查看項目目錄下是否已經(jīng)生成項目文件,如果有,強制關(guān)閉as進程,重啟后打開此項目

flutter packages get運行時提示等待另一個flutter指令

Waiting for another flutter command to release the startup lock…

  1. 打開flutter的安裝目錄/bin/cache/
  2. 刪除lockfile文件
  3. 刪除不掉則強制退出Dart.exe再刪除
  4. 重啟AndroidStudio

參見issues 7768

Resolving dependencies...

改android里build.gradle腳本的倉庫源

buildscript { repositories { maven { url 'https://maven.aliyun.com/repository/google' } maven { url 'https://maven.aliyun.com/repository/jcenter' } maven { url 'http://maven.aliyun.com/nexus/content/groups/public' } //google() //jcenter() }dependencies { classpath 'com.android.tools.build:gradle:3.2.1' } }allprojects { repositories { maven { url 'https://maven.aliyun.com/repository/google' } maven { url 'https://maven.aliyun.com/repository/jcenter' } maven { url 'http://maven.aliyun.com/nexus/content/groups/public' } //google() //jcenter() } } 

本頁內(nèi)容由塔燈網(wǎng)絡(luò)科技有限公司通過網(wǎng)絡(luò)收集編輯所得,所有資料僅供用戶學(xué)習(xí)參考,本站不擁有所有權(quán),如您認(rèn)為本網(wǎng)頁中由涉嫌抄襲的內(nèi)容,請及時與我們聯(lián)系,并提供相關(guān)證據(jù),工作人員會在5工作日內(nèi)聯(lián)系您,一經(jīng)查實,本站立刻刪除侵權(quán)內(nèi)容。本文鏈接:http://caipiao93.cn/18161.html
相關(guān)APP開發(fā)
 八年  行業(yè)經(jīng)驗

多一份參考,總有益處

聯(lián)系深圳網(wǎng)站公司塔燈網(wǎng)絡(luò),免費獲得網(wǎng)站建設(shè)方案及報價

咨詢相關(guān)問題或預(yù)約面談,可以通過以下方式與我們聯(lián)系

業(yè)務(wù)熱線:余經(jīng)理:13699882642

Copyright ? 2013-2018 Tadeng NetWork Technology Co., LTD. All Rights Reserved.