Flutter: build_runner build command runs indefinitely

0

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
database flutter flutter-moor
2021-11-24 04:05:46
2

1

This problem was occured for me after upgrading the Flutter. I solved it by cleaning and upgrading the project dependencies again. Run the below commands in the root directory of your project:

   flutter clean
    flutter packages pub upgrade
    flutter pub run build_runner build

Also as others said, please make sure your sdk version in the pubspec.yaml is compatible with your flutter sdk version.

Also, sdk verision should be at least sdk: ">=2.12.0 <3.0.0" for that syntax

2021-11-24 04:10:18

I tried running this commands, no results. My sdk version were ">=2.1.0 <3.0.0". I changed it to what you suggested and used commands again. Now i'm getting pub finished with exit code 78
IBlackVikingl

flutter packages pub run build_runner build --delete-conflicting-outputs run this command
Anmol Mishra

I got the same error
IBlackVikingl

can you share flutter channel name
Anmol Mishra

Sure, but can you specify how can i do it?
IBlackVikingl

flutter channel
Anmol Mishra

Anmol Mishra
0

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

2021-11-24 05:19:53

In other languages

This page is in other languages

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................