Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 453 Vote(s) - 3.44 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why doesn't build_runner generate files when serializing JSON in dart/flutter

#11
I had the same issue. Solved by using the below command

flutter packages pub run build_runner build --delete-conflicting-outputs
Reply

#12
I had a similar issue, but I am using Android Studio IDE and I have done the following step:

**File => Invalidate caches / Restart**

Run following command:

flutter clean

flutter pub get

flutter packages pub run build_runner build --delete-conflicting-outputs

About **--delete-conflicting-outputs**

Assume conflicting outputs in the users package are from previous builds, and skip the user prompt that would usually be provided.

[Reference][1]


[1]:

[To see links please register here]

Reply

#13
Add built_value_generator to the `pubspec.yaml` to `dev_dependencies` section

[To see links please register here]


You can read the official documentation -

[To see links please register here]

Reply

#14
In my case the build_runner process was successful but the .g files weren't produced. I had to restart the IDE (vscode) before I start seeing the .g files.
Reply

#15
try something like this via terminal:
1. Delete previous generated files via command: find ./ -name '*.g.dart' -delete
2. then: flutter packages pub run build_runner watch —delete-conflicting-outputs
Reply

#16
The issue is with package dependency, executing this `flutter pub upgrade --major-versions` will do the thing.
Reply

#17
changing the part and class to the same name of the file fixed the issue with me
Reply

#18
Make sure this `targets` bit goes into `build.yaml` and **NOT** `pubspec.yaml`.
Reply

#19
Add this file in the root directory with `pubspec.yaml`

`build.yaml` file

Add the following lines

targets:
$default:
builders:
freezed:
options:
any_map: true
explicit_to_json: true

Then run

flutter clean
flutter pub get
flutter packages pub run build_runner build --delete-conflicting-outputs
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through