关于fultter的问题记录 QAQ

发布时间 2023-11-18 22:09:37作者: 青柚

当前操作系统IDE版本以及flutter版本

image

image

image

版本不同可能相应的设置不同,请酌情参考,如有帮助到你那么就是最好。

祝 Flutter 使用愉快!


1. Android Studio 的版本升级以后的选择设备构建步骤

  • 1.0 可以直接参考官方方法:https://developer.android.google.cn/studio/run/managing-avds.html?hl=zh-cn

    升级到最新的软件后在左上角的调试设备中没有移动设备需要自己创建
    image
    1.1 点击左侧的小图标
    image
    1.2 点击 Create Device 按钮进行创建
    image
    1.3 选择需要的型号,然后下一步
    image
    1.4 选择安卓的System Image
    image
    1.5 可以在设置名称,然后下一步
    image
    1.6 创建完成
    image

2. HAXM安装失败(Intel HAXM installation failed. To install Intel HAXM follow the...)

  • 2.1 检查你电脑的虚拟化是否开启。路径:控制面板->程序->启用或关闭windows功能
    image
    2.2 如果未开启,可以点击安装重启,如重启还是失败,则需要设置BIOS(Basic Input Output System)中开启。F10保存以后重启。
    image

3. Android toolchain - develop for Android devices ...

  • 3.1 打开设置
    image
    3.2 选择SDK Manager... ,选择红框中SDK Tools进行安装,安装后重启IDE
    image
    3.2 然后在终端中输入 flutter doctor --android-licenses 终端执行,一路输入y。最后在输入flutter doctor
    image

4. Running Gradle task assembleDebug...

  • 4.1 直接将远程的文件先下载到本地,然后切换成本地路径
    image
    4.2 更改源为阿里云 注意:不能是http开头,必须是https的开头
    maven { url 'https://maven.aliyun.com/repository/google' }
    maven { url 'https://maven.aliyun.com/repository/jcenter' }
    maven { url 'https://maven.aliyun.com/nexus/content/groups/public' }
    image
    4.3 可能和你的路径不一样,我这里版本高,官方做了优化,
    image
    如果在图中路径没有,那么就在
    image
    注意最好是运行flutter clean后再次进行打包动作
    各个电脑网络环境不一样,请酌情参考!

5.NO_PROXY is not set

  • 5.1 执行flutter doctor时候报出的问题 执行set No_PORXY="localhost,127.0.0.1"后再次尝试

6.X HTTP host "https://cloud.google.com/" is not reachable. Reason: An error occurred while checking the HTTP host: 信号灯超时时间问题

  • 6.1 需要使用上网工具,然后查看你代理的端口进行设置
    $Env:http_proxy="http://127.0.0.1:7890";$Env:https_proxy="http://127.0.0.1:7890"
    其中的 7890 则需要换成你的工具中的端口 要在你的vscode或者IDE的终端执行
    此处参考:https://zhuanlan.zhihu.com/p/628884731