• mac上如何配置flutter之安卓


    注意说明:mac上一定要安装java环境,再配上以下变量,已配置的略过

    JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home
    PATH="$JAVA_HOME/bin:$PATH"
    CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar:.
    export JAVA_HOME
    export PATH
    export CLASSPATH

    这里是配置安卓环境,已配置的略过

    export ANDROID_HOME=/Users/mm/Library/Android/sdk
    export PATH=${PATH}:${ANDROID_HOME}/tools
    export PATH=${PATH}:${ANDROID_HOME}/platform-tools

    1.按以下配置

    1.终端中输入以下指令克隆项目 git clone -b beta https://github.com/flutter/flutter.git (或git clone -b dev https://github.com/flutter/flutter.git)
    2. 导出到Flutter保存路径 export PATH=`pwd`/flutter/bin:$PATH
    3.export PUB_HOSTED_URL=https://pub.flutter-io.cn
    4.export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
    5.export PATH="$PWD/flutter/bin:$PATH"
    6.cd ./flutter
    7.flutter doctor

    2.完成第8步会输出以下,表示输出完成

    [✓] Flutter (Channel beta, 1.20.2, on Mac OS X 10.15.6 19G2021, locale
        zh-Hans-CN)
     
    [!] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
        ✗ Android licenses not accepted.  To resolve this, run: flutter doctor
          --android-licenses
    [!] Xcode - develop for iOS and macOS (Xcode 11.6)
        ✗ CocoaPods not installed.
            CocoaPods is used to retrieve the iOS and macOS platform side's plugin
            code that responds to your plugin usage on the Dart side.
            Without CocoaPods, plugins will not work on iOS or macOS.
            For more info, see https://flutter.dev/platform-plugins
          To install:
            sudo gem install cocoapods
    [✓] Android Studio (version 3.5)
    [!] Connected device
        ! No devices available

    4.打开android studio 安装 flutter、dart插件

    5.安装完后在终端输入flutter doctor,若报错Android license status unknown ,请看我上一篇文章

    6.安装完成后,创建flutter项目

    flutter create appname

    7.创建完成后进入项目,需要提前打开模拟器

    flutter run

     8.以下是安卓上的运行效果,由于配置xcode比安卓简单,就不记录了

     

  • 相关阅读:
    分布式文件系统--->fastDFS
    varnish4.0缓存代理配置
    varnish4.0缓存代理配置
    varnish4.0缓存代理配置
    SDN 是什么
    SDN 是什么
    SDN 是什么
    Solidworks如何保存为网页可以浏览的3D格式
    github 的 配置SSH
    当一个实例被创建,__init__()就会被自动调用
  • 原文地址:https://www.cnblogs.com/lude1994/p/13345087.html
Copyright © 2020-2023  润新知