Hemedi
Hemedi

Reputation: 183

*[SEVERE]* Failed to precompile build script .dart_tool/build/entrypoint/build.dart. This is likely caused by a misconfigured builder definition

[INFO] Precompiling build script......
[WARNING] ../../flutter/.pub-cache/hosted/pub.dartlang.org/gql_code_builder-0.2.0/lib/src/ast.dart:618:12: Error: A non-null value must be returned since the return type 'Expression' doesn't allow null.
 - 'Expression' is from 'package:code_builder/src/specs/expression.dart' ('../../flutter/.pub-cache/hosted/pub.dartlang.org/code_builder-4.1.0/lib/src/specs/expression.dart').
Expression _directiveLocation(DirectiveLocation location) {
           ^
[INFO] Precompiling build script... completed, took 838ms

[SEVERE] Failed to precompile build script .dart_tool/build/entrypoint/build.dart.
This is likely caused by a misconfigured builder definition.

Upvotes: 18

Views: 13295

Answers (4)

serena7889
serena7889

Reputation: 56

Deleting the pubspec.lock file fixed it for me.

In my case, this seems to have been caused by running flutter pub get with circular dependancies.

Upvotes: 2

Berke Uğur
Berke Uğur

Reputation: 371

flutter pub upgrade && flutter clean && flutter pub cache clean

this helped me

Upvotes: 21

Andrey Alexandrov
Andrey Alexandrov

Reputation: 168

Try "flutter pub upgrade". This helped me.

Upvotes: 10

matteodg
matteodg

Reputation: 64

It looks like here there is a fix gql-dart/gql#308

dependency_overrides:
  gql: 0.13.0

Upvotes: 2

Related Questions