flutter pub run build_runner build failed flutter pub run build_runner build failed dart dart

flutter pub run build_runner build failed


Try this.

flutter pub get && flutter pub run build_runner build --delete-conflicting-outputs


add dependency in pubsec.yaml, analyzer: '0.39.14'

flutter cleanflutter pub cache repairflutter pub run build_runner clean

Then run,

flutter pub run build_runner build


I got this to work with the latest build_runner and json_serializable versions after a long process of trying all of the above suggestions:build_runner: ^1.10.2json_serializable: ^3.4.0Not sure what ultimately worked, but looks like one of the issues in my case was a slightly outdated dart SDK, so that's one more thing to keep an eye on