Build Output
This list gives you some tips to control and manage the generated files coming out of the build_runner
.
Use the correct SDK version
The version of the sdk
used in the pubspec.yaml
has a big influence on what packages are downloaded as part of the pub get
command. Make sure you are using at least 2.1.0-dev
.
watch
command
Continuous generation with the As you work on your stores, you would want to keep the build_runner
active, constantly generating the *.g.dart
files. The trick to keep it running is to use the watch
sub-command, as shown below:
OR
Starting a clean build
Sometimes build_runner
will simply refuse to run the build if you already have some generated files. This could happen if the version of dart or flutter has changed. In those case, it is best to start clean and regenerate all the files. You can either use the clean
sub-command or simply start off by deleting the existing generated files.
- Clean and remove all generated files
- Delete conflicting files
Unable to run the app in iOS Simulator (Old iOS Deployment Target)
It is possible that sometimes your app would simply fail to run on the simulator. You might see a weird error message like so:
The real issue seems to be the fact that the Deployment Target
has been set to iOS 8.0. This should be at least 12.0. Open up the Runner.xcworkspace
file in XCode and change the deployment target as below:

- Once you make this change, be sure to remove the app from your simulator and restart the simulator.
- With that change, you should be back in action!