Flutter: build_runner build command runs indefinitely

Issue

i have an old Flutter project. In it i have this error part 'Target of URI hasn't been generated: 'MoorDatabase.g.dart'.Try running the generator that will generate the file referenced by the URI.. So i used this command flutter pub run build_runner build. But it shows me this error Bad state: Unexpected diagnostics: C:\flutter\bin\cache\dart-sdk\lib\internal\internal.dart:691:16 - This requires the 'non-nullable' language feature to be enabled.[SEVERE] floor_generator:floor_generator on test/bloc/report_bloc_test.dart:. How can i fix it?

What have i already done:

  1. i used flutter pub upgrade command and it upgraded some of the dependencies. 88 packages have newer versions incompatible with dependency constraints. I tried to update all the dependencies manually, but most of them were incompatible with each other
  2. tried to sync project in Android Studio and restart dart analytics
  3. cleared cache and re-downloaded dependencies

Solution

Error was fixed by changing sdk version and manually updating all the dependencies, with fixing compatibility issues

Answered By – IBlackVikingl

Answer Checked By – Gilberto Lyons (FlutterFixes Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *