升级到Xcode 12 flutter 库报错问题

升级xcode12 导致各种库报错、解决了半天奈何也无效果、最后没办法只有退回到xcode11版本、

退回版本只需要切好到对应的xcode 版本即可、

1、首先下载对应的xcode版本、安装方法如下,然后按照下面的方法切换xcode版本、
2、输入flutter doctor 检查 安装的版本是否正确、如果不行再重启下工具、或者重启电脑 最后再次flutter doctor 应该就没问题了

升级到Xcode 12 flutter 库报错问题_第1张图片
18AA3202-55BD-46E5-B6B6-1A40BC049FF4.png

有时候会遇到需要一些旧的版本Xcode的情况,这样电脑上就要安装多个Xcode。
各个版本的Xocde下载地址

首先需要安装Command Line Tools

Command Line Tools , 下载与当前系统和安装的Xcode对应的Command Line Tools(其他版本的Xcode也在这里下载)

1、显示当前使用的Xcode

xcode-select -p
//输出:Applications/Xcode.app/Contents/Developer

2、切换Xcode版本

在shell中, 输入(后面的路径为已安装的且要切换到得Xcode路径):

  sudo xcode-select -s /Applications/Xcode10.2/Xcode.app/Contents/Developer

查看当前版本

  gcc --version
//输出:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.0 (clang-1000.11.45.5)
Target: x86_64-apple-darwin18.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

你可能感兴趣的:(升级到Xcode 12 flutter 库报错问题)