美文网首页
2018-03-12 Flutter初体验

2018-03-12 Flutter初体验

作者: Android小人 | 来源:发表于2018-03-12 17:10 被阅读0次

    Flutter的安装指南

    Flutter的安装可以参考官方的文档,我这以windows为例,首先clone flutter的的源码,选择beta版本,这是最近才更新的:

    1. git clone -b beta https://github.com/flutter/flutter.git
    2. 配置PATH目录。
      把flutter目录下的bin加到PATH的系统目录里面。打开cmd 输入flutter,看看是否会出现flutter有关的信息,这
      里需要注意一点的就是你必须把git的exe文件也添加到系统的PATH的目录里面要不这里会提示你找不到git程
      序。
    3. 执行命令flutter doctor。
      犹豫特殊环境有可能被墙了所以需要多试几次。执行成功的话就会出现类似这样的结果:
    flutter renyugang$ flutter doctor
    Doctor summary (to see all details, run flutter doctor -v):
    [✓] Flutter (Channel beta, v0.1.5, on Mac OS X 10.11.1 15B42, locale zh-Hans)
    [✓] Android toolchain - develop for Android devices (Android SDK 26.0.2)
    [!] iOS toolchain - develop for iOS devices (Xcode 7.3.1)
        ✗ Flutter requires a minimum Xcode version of 9.0.0.
          Download the latest version or update via the Mac App Store.
        ✗ libimobiledevice and ideviceinstaller are not installed. To install, run:
            brew install --HEAD libimobiledevice
            brew install ideviceinstaller
        ✗ ios-deploy not installed. To install:
            brew install ios-deploy
        ✗ CocoaPods not installed.
            CocoaPods is used to retrieve the iOS platform side's plugin code that responds to your plugin usage on the Dart side.
            Without resolving iOS dependencies with CocoaPods, plugins will not work on iOS.
            For more info, see https://flutter.io/platform-plugins
          To install:
            brew install cocoapods
            pod setup
    [✓] Android Studio (version 3.0)
    [✓] IntelliJ IDEA Community Edition (version 2017.3.1)
    [✓] Connected devices (1 available)
    ! Doctor found issues in 1 category.
    
    1. 打开Android Studio选择File---new project---new Flutter project----flutter Application点击next,到这一步会让你选择Flutter的sdk如果flutter doctor执行成功的话这里的sdk就会自动填上如果没成功则不能接着往下执行。然后点击finish,到这里工程就已经建完了。
      最后说一点就是android sdk的问题如果你需要改变默认的sdk的目录的话就得在local.properties里面修改如图:



      修改后打开模拟器,点击运行。

    相关文章

      网友评论

          本文标题:2018-03-12 Flutter初体验

          本文链接:https://www.haomeiwen.com/subject/mttofftx.html