3

I have an issue when trying to generate a Json Serializable Generator using Build Runner in Dart. First, I tried to do run flutter packages pub run build_runner build to generate Json Serializable but it showed that it has a conflicting issue. So I run command --delete-conflicting-outputs, to solve the conflicting issue.

After that I tried to run flutter packages pub run build_runner build again to regenerate the Json value. But the result that i got is like this:

succeeded with no outputs

So the output was : [INFO] Succeeded after 137ms with 0 outputs (0 actions)

I get so stressed because of it because all of generated-files were deleted. can somebody tell me what was happening and how to solve this issue?

I have been checking everywhere but still haven't found an answer.

flutteria
  • 151
  • 2
  • 8

5 Answers5

10
flutter pub run build_runner watch --delete-conflicting-outputs
Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
gowthaman C
  • 472
  • 6
  • 16
1

You should update your pubspec

dependencies:
  # Your other regular dependencies here
  json_annotation: <latest_version>

dev_dependencies:
  # Your other dev_dependencies here
  build_runner: <latest_version>
  json_serializable: <latest_version>

then run flutter pub run build_runner build

gtr Developer
  • 2,369
  • 16
  • 12
0

Make sure the name of the .g.dart is written properly.

I ran into the same issue came here looking for a solution and when did not find one I noticed the name of the file to be generated is case sensitve.

ammar188
  • 83
  • 1
  • 5
0

For me it was not having the files underneath the /lib or /bin directories.

Checklist

Here's a checklist of things to check when Json_serializable generator has succeeded with no outputs, but no files are generated.

Baker
  • 24,730
  • 11
  • 100
  • 106
0

Try this:

dart run build_runner build --delete-conflicting-output