Generate a Json Serializable Generator using Build Runner in Flutter: Response is Succeeded, but no output is being generated
flutter pub run build_runner watch --delete-conflicting-outputs
flutteria
Flutter Developer from Salatiga, Indonesia. Part of Flutteristas. Hey, there!
Updated on December 09, 2022Comments
-
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: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 about 5 yearsIt is better to put the output as text, not as image.
-
Günter Zöchbauer about 5 yearsDid you add
@JsonSerializable()
annotation to your classes? Did you create abuild.yaml
, if yes, what does it contain? -
flutteria about 5 yearsYes 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 about 3 yearsPlease consider adding some explanation to what the exact purpose of this command is
-
Krzysztof Cieśliński almost 3 yearsYou 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