skip to Main Content

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


  1. Chosen as BEST ANSWER

    Resolved issue by upgrading build_runner dependency

    Steps:

    1. Open Project in Android Studio

    2. Navigate to Terminal Tab in Android Studio

    3. Execute the below command

      $ flutter pub upgrade

    4. Run the application.

    The above solution worked for me. Hope, it will help to others as well.


  2. I use flutter3.10.5 version, and I also encountered the same error when using build_runner. Confusingenter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search