在升級(jí)Flutter SDK時(shí)可能會(huì)報(bào)如下錯(cuò)誤:
Your flutter checkout has local changes that would be erased by upgrading. If you want to keep these changes, it is recommended that you stash them via “git stash” or else commit the changes to a local branch. If it is okay to remove local changes, then re-run this command with --force.
exit code 1
這個(gè)有可能是在下載老版SDK的時(shí)候近范,分支切換到了beta分支上,如果是這種情況只要把分支切換到stable/dev分支 再用flutter upgrade更新就可以了,不過我的情況不太一樣擒滑,我下載sdk分支就是stable挽唉,所以有可能是修改某些配置文件時(shí)有沖突導(dǎo)致無法更新牛哺,這時(shí)可以用git的可視化工具sourcetree查看沖突的內(nèi)容蟆豫,直接用它更新flutter sdk項(xiàng)目也是可以的零院。