美文网首页
【Flutterr】初次安装踩坑记录

【Flutterr】初次安装踩坑记录

作者: Piemon_Jay | 来源:发表于2021-05-10 14:02 被阅读0次

    1、按照官网提示,在vscode中安装好插件后,执行flutter doctor

    报错:

    ✗Android sdkmanager tool not found
    

    原因:未安装安卓SDK
    自行搜索并安装androidSDK,JDK的版本选择8,不要选最新的,安装完成配置好环境变量

    2、再次执行flutter doctor

    报错:

    ✗Android license status unknown
    

    原因:需要添加Android license
    解决操作、执行命令:

    flutter doctor --android-licenses
    

    可能引起报错:

    Unknown argument --licenses
    

    3、进入安卓SDK/tools/bin目录,更新sdk

    执行命令

    sdkmanager --update
    

    完成显示done

    4、再次执行

    flutter doctor --android-licenses
    

    依旧报错:

    Unknown argument --licenses
    

    5、修改文件夹名称 "tools" => "tools2",执行命令:

    sdkmanager --include_obsolete "tools"
    

    查看发现生成新的tools文件夹后,可以删除tools2

    7、再次执行命令:

    flutter doctor --android-licenses
    

    所有确认全部填y

    ...
    Review licenses that have not been accepted (y/N)? y
    ...
    

    完成后显示:

    All SDK package licenses accepted
    

    8、最后再次执行flutter doctor检查

    [flutter] flutter doctor -v
    [√] Flutter (Channel stable, 2.0.6, on Microsoft Windows [Version 10.0.18363.1443], locale zh-CN)
        • Flutter version 2.0.6 at D:\flutter_windows_2.0.6-stable\flutter
        • Framework revision 1d9032c7e1 (10 days ago), 2021-04-29 17:37:58 -0700
        • Engine revision 05e680e202
        • Dart version 2.12.3
        • Pub download mirror https://pub.flutter-io.cn
        • Flutter download mirror https://storage.flutter-io.cn
    
    [√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
        • Android SDK at D:\AndroidSDK
        • Platform android-R, build-tools 29.0.3
        • ANDROID_SDK_ROOT = D:\AndroidSDK
        • Java binary at: C:\Program Files\Common Files\Oracle\Java\javapath\java.exe
        • Java version Java(TM) SE Runtime Environment (build 1.8.0_291-b10)
        • All Android licenses accepted.
    
    [√] Chrome - develop for the web
        • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
    
    [!] Android Studio (not installed)
        • Android Studio not found; download from https://developer.android.com/studio/index.html
          (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).
    
    [√] Connected device (2 available)
        • Chrome (web) • chrome • web-javascript • Google Chrome 89.0.4389.90
        • Edge (web)   • edge   • web-javascript • Microsoft Edge 90.0.818.49
    
    ! Doctor found issues in 1 category.
    exit code 0
    

    无报错。至此,安装完成!

    相关文章

      网友评论

          本文标题:【Flutterr】初次安装踩坑记录

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