升級(jí)xcode12 導(dǎo)致各種庫報(bào)錯(cuò)汉柒、解決了半天奈何也無效果、最后沒辦法只有退回到xcode11版本责鳍、
退回版本只需要切好到對(duì)應(yīng)的xcode 版本即可碾褂、
1、首先下載對(duì)應(yīng)的xcode版本历葛、安裝方法如下正塌,然后按照下面的方法切換xcode版本、
2恤溶、輸入flutter doctor 檢查 安裝的版本是否正確乓诽、如果不行再重啟下工具、或者重啟電腦 最后再次flutter doctor 應(yīng)該就沒問題了
18AA3202-55BD-46E5-B6B6-1A40BC049FF4.png
有時(shí)候會(huì)遇到需要一些舊的版本Xcode的情況咒程,這樣電腦上就要安裝多個(gè)Xcode鸠天。
各個(gè)版本的Xocde下載地址
首先需要安裝Command Line Tools
Command Line Tools , 下載與當(dāng)前系統(tǒng)和安裝的Xcode對(duì)應(yīng)的Command Line Tools(其他版本的Xcode也在這里下載)
1、顯示當(dāng)前使用的Xcode
xcode-select -p
//輸出:Applications/Xcode.app/Contents/Developer
2帐姻、切換Xcode版本
在shell中, 輸入(后面的路徑為已安裝的且要切換到得Xcode路徑):
sudo xcode-select -s /Applications/Xcode10.2/Xcode.app/Contents/Developer
查看當(dāng)前版本
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