Generate a Json Serializable Generator using Build Runner in Flutter: Response is Succeeded, but no output is being generated

4,826
flutter pub run build_runner watch --delete-conflicting-outputs
Share:
4,826
flutteria
Author by

flutteria

Flutter Developer from Salatiga, Indonesia. Part of Flutteristas. Hey, there!

Updated on December 09, 2022

Comments

  • flutteria
    flutteria over 1 year

    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.

    • alex.pulver
      alex.pulver about 5 years
      It is better to put the output as text, not as image.
    • Günter Zöchbauer
      Günter Zöchbauer about 5 years
      Did you add @JsonSerializable() annotation to your classes? Did you create a build.yaml, if yes, what does it contain?
    • flutteria
      flutteria about 5 years
      Yes I add a @JsonSerializable(). but I didn't create the build.yaml, i only have the pubspec.yaml and it was ok before i run the --delete-conflicting-outputs
  • mousetail
    mousetail about 3 years
    Please consider adding some explanation to what the exact purpose of this command is
  • Krzysztof Cieśliński
    Krzysztof Cieśliński almost 3 years
    You saved my day. It works. It generates fromJson and toJson methods based on latest changes. Surprisingly it's not generated during build by default :O