克隆repo并运行命令pub get会引发此错误:
在 pubspec.yaml 中检测到错误:
在“flutter”下发现了意外的孩子“generate”。
请更正 C:\Users\m3\repos\gallery\pubspec.yaml 中的 pubspec.yaml 文件
运行存储库上建议的这些命令,不能解决错误:
C:\Users\m3\repos\fork\gallery>C:\Users\m3\Downloads\flutter_windows_1.20.4-stable\flutter\bin\flutter.bat channel master
C:\Users\m3\repos\fork\gallery>C:\Users\m3\Downloads\flutter_windows_1.20.4-stable\flutter\bin\flutter.bat upgrade
C:\Users\m3\repos\fork\gallery>C:\Users\m3\Downloads\flutter_windows_1.20.4-stable\flutter\bin\flutter.bat channel stable
C:\Users\m3\repos\fork\gallery>C:\Users\m3\Downloads\flutter_windows_1.20.4-stable\flutter\bin\flutter.bat upgrade
Run Code Online (Sandbox Code Playgroud)
仅通过运行这两个命令即可解决该错误:
C:\Users\m3\repos\fork\gallery>C:\Users\m3\Downloads\flutter_windows_1.20.4-stable\flutter\bin\flutter.bat channel master
C:\Users\m3\repos\fork\gallery>C:\Users\m3\Downloads\flutter_windows_1.20.4-stable\flutter\bin\flutter.bat upgrade
Run Code Online (Sandbox Code Playgroud)
当您使用此存储库时,请留在master频道中并且不要返回频道。stable
| 归档时间: |
|
| 查看次数: |
959 次 |
| 最近记录: |