Cloning a repo and running command pub get
throws this error:
Error detected in pubspec.yaml:
Unexpected child "generate" found under "flutter".
Please correct the pubspec.yaml file at C:\Users\m3\repos\gallery\pubspec.yaml
Running these commands suggested on repository, does NOT solve the error:
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
A bit late to the party, but I fixed it by upgrading flutter with flutter upgrade
.
The error got resolved by running these two commands only:
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
Stay in master
channel and do NOT return to stable
channel, while you're working on this repository.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With