1. 執(zhí)行時(shí),iOS端報(bào)錯(cuò)
[!] An error occurred while processing the post-install hook of the Podfile.
undefined method `each_child' for #<Dir:0x00007fd6c037b538>
應(yīng)該是cocoapods上出錯(cuò)竣灌,
google后得知 cocoapods的版本應(yīng)該在 1.9.0 以上
升級后档玻,無效
再查 是ruby 的版本應(yīng)該在 2.6.0 及以上
這里使用rvm 來切換版本
rvm install 2.6.0
中間也是出現(xiàn)了一堆各種各樣的問題谱姓,
安裝時(shí)衩侥,讓我先升級 brew 国旷,執(zhí)行brew update
又出錯(cuò),讓我去 unshallow茫死,
然后 執(zhí)行時(shí)又被網(wǎng)絡(luò)卡住跪但,
更換 brew 的鏡像 參考:http://www.reibang.com/p/77c60428569d 換 清華的源
接下來,一切順利了峦萎。
再次執(zhí)行 pod install 正常了特漩。
后來發(fā)現(xiàn),在VSCode中出錯(cuò)骨杂,也是因?yàn)闆]有切換到 ruby 2.6.0版本的問題涂身。
應(yīng)該在VSCode中設(shè)置一下,但找了一圈沒找到哪里可以更改當(dāng)前項(xiàng)目的搓蚪。
那就改系統(tǒng)的
rvm --default use 2.6.0
不是很好蛤售,但暫時(shí)能用了
2. Error: Cannot run with sound null safety, because the following dependencies don't support null safety:
有些包不支持 safety模式,暫時(shí)不用
flutter run --no-sound-null-safety
正常
如果使用VSCode 的話妒潭, 需要在launch.json中添加同樣的參數(shù)
"version": "0.2.0",
"configurations": [
{
"name": "flutterapp",
"request": "launch",
"type": "dart",
"args":["--no-sound-null-safety"]
}
]