錯誤描述:
Warning! This package referenced a Flutter repository via the .packages file that is no longer available. The repository from which the 'flutter' tool is currently executing will be
used instead.
running Flutter tool: /Users/sunyd/Desktop/DevelopTool/flutter
previous reference : /Users/sunyd/Desktop/DevelopTool/flutter-stable
This can happen if you deleted or moved your copy of the Flutter repository, or if it was on a volume that is no longer mounted or has been mounted at a different location. Please
check your system path to verify that you are running the expected version (run 'flutter --version' to see which flutter is on your path).
起因:
本地使用的flutter sdk版本是1.9.1。想體驗(yàn)下官方的最新版本,所有在現(xiàn)有的flutter 同級目錄,下載了官方stable分支下的最新版本。
但是打開現(xiàn)有錯誤卻報(bào)錯了。
錯誤位置:
通過錯誤提示可以看出.packages文件出了問題。
打開.packages文件,發(fā)現(xiàn)工程中的員sdk路徑都變成了新的。
解決方案一:
(我沒有嘗試,因?yàn)檫@樣會重新下載所有插件依賴。對于我們的項(xiàng)目來說很多插件不好下載。)
刪除.packages重新build。
解決方案二:
(解決我的問題)
打開.packages,將新的flutter sdk路徑,全局替換成之前的路徑。