I was getting the below error while running the flutter application post flutter upgrade to 3.10.6
Failed to build build_runner:build_runner:
/C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/build_runner-2.3.2/lib/src/build_script_generate/bootstrap.dart:76:40: Error: Method not found: 'NullThrownE
rror'.
final error = e[0] as Object? ?? NullThrownError();
^^^^^^^^^^^^^^^
For me this happen because the incompatibility of each package used. I think the packages that relate to build runner are floor_generator and retrofit_generator. You can simply resolve the issue by following these:
retrofit_generator, floor_generator and build_runner from dev_dependenciesflutter pub add dev:build_runner, flutter pub add dev:floor_generator and flutter pub add dev:retrofit_generatordart run build_runner buildor if the error still occur try this package version:
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