flutter 常见错误(持续更新)

  • error1
    引用三方库后,执行flutter run报错
    Cloning into '/var/folders/gz/3_764jfj7lx3xwh5qw26r8_r0000gn/T/d20220519-15307-fuhzat'...
    fatal: unable to access 'https://github.com/Weebly/OrderedSet.git/': Failed to connect to github.com port 443 after 75009 ms: Operation timed out
    Error running pod install
    Error launching application on iPhone SE (3rd generation).
    解决方案:https://juejin.cn/post/6844904193170341896

  • err0r2
    Cloning into '/var/folders/gz/3_764jfj7lx3xwh5qw26r8_r0000gn/T/d20220519-16462-9coun7'...
    fatal: unable to access 'https://github.com/Weebly/OrderedSet.git/': HTTP/2 stream 1 was not closed cleanly before end of the underlying stream
    Error running pod install
    Error launching application on iPhone SE (3rd generation).
    原因:是 git 默认使用的通信协议出现了问题,可以通过将默认通信协议修改为 http/1.1 来解决该问题。
    解决方案:git config --global http.version HTTP/1.1

  • error3 导入flutter_boost后报错 import 'package:flutter_boost/flutter_boost.dart';

version older than the deployment target. Functionality may be limited. [9]
    ../../Documents/flutter/.pub-cache/git/flutter_boost-0e675b9922bee4401b5f5c90a7539a0366c0ec99/lib/src/messages.dart:4:1: Error: A library can't opt out of null safety by default,
    when using sound null safety.
    // @dart = 2.8
    ^^^^^^^^^^^^^^
    Error: Cannot run with sound null safety, because the following dependencies
    don't support null safety:

     - package:flutter_boost

原因:flutter_boost应用的版本有问题,调整到null-safety-release.1版本即可解决。

flutter_boost:
    git:
      url: 'https://github.com/alibaba/flutter_boost.git'
      ref: 'v3.0-null-safety-release.1'

你可能感兴趣的:(flutter 常见错误(持续更新))