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();
^^^^^^^^^^^^^^^
2
Answers
Resolved issue by upgrading build_runner dependency
Steps:
Open Project in Android Studio
Navigate to Terminal Tab in Android Studio
Execute the below command
$ flutter pub upgrade
Run the application.
The above solution worked for me. Hope, it will help to others as well.
I use flutter3.10.5 version, and I also encountered the same error when using build_runner. Confusingenter image description here