Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

brick.g.dart is not generated #344

Closed
Mikhail-Ivanou opened this issue Jun 20, 2023 · 7 comments
Closed

brick.g.dart is not generated #344

Mikhail-Ivanou opened this issue Jun 20, 2023 · 7 comments
Assignees

Comments

@Mikhail-Ivanou
Copy link

Hey, I've tried to migrate brick to latest version with dart 3, and face issue that brick.g.dart is not generated.

So I get generated adapters with
part of '../brick.g.dart';
But actually no brick.g.dart exists.

Tried alos samples, they have similar issue.

[√] Flutter (Channel stable, 3.10.5, on Microsoft Windows [Version 10.0.17763.4499], locale ru-RU) (Issue is reproducible on mac too)

PS D:\git\brick\example_rest> flutter --version
Flutter 3.10.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 796c8ef792 (6 days ago) • 2023-06-13 15:51:02 -0700
Engine • revision 45f6e00911
Tools • Dart 3.0.5 • DevTools 2.23.1

What can be wrong?

@tshedor
Copy link
Collaborator

tshedor commented Jun 20, 2023

Hi @Mikhail-Ivanou what version of Brick are you migrating from? Are there any build errors in your console when running dart run build_runner build --delete-conflicting-outputs?

@tshedor tshedor self-assigned this Jun 20, 2023
@Mikhail-Ivanou
Copy link
Author

initially it was

 brick_sqlite: ^1.1.0
  brick_rest: ^1.1.0
  brick_offline_first: ^1.1.0

than it was updated to

brick_sqlite: ^2.0.0
brick_rest: ^1.1.1
brick_offline_first: ^2.1.2
brick_offline_first_with_rest: ^1.1.0

Now I update to
brick_sqlite: ^3.0.1 brick_rest: ^3.0.2 brick_offline_first: ^3.0.3 brick_offline_first_with_rest: ^3.0.1

Here is what I see in terminal for main project
PS D:\git\xxxx-mobile-app> dart run build_runner build --delete-conflicting-outputs [INFO] Generating build script completed, took 365ms [INFO] Reading cached asset graph completed, took 2.3s [INFO] Checking for updates since last build completed, took 1.2s [INFO] Running build completed, took 2m 3s [INFO] Caching finalized dependency graph completed, took 706ms [INFO] Succeeded after 2m 3s with 75 outputs (1093 actions)

and also no errors or warnings for sample
PS D:\git\brick\example_rest> dart run build_runner build --delete-conflicting-outputs Building package executable... (5.6s) Built build_runner:build_runner. [INFO] Generating build script completed, took 278ms [INFO] Precompiling build script... completed, took 5.8s [INFO] Checking for unexpected pre-existing outputs. completed, took 0ms [INFO] Generating SDK summary completed, took 3.8s [INFO] Running build completed, took 5.1s [INFO] Caching finalized dependency graph completed, took 21ms [INFO] Succeeded after 5.1s with 3 outputs (9 actions)

@tshedor
Copy link
Collaborator

tshedor commented Jun 20, 2023

@Mikhail-Ivanou did you follow the migration guide from 1 -> 2 or did you just change the pub versions? Notably, are your files models/user.dart or user.model.dart?

@Mikhail-Ivanou
Copy link
Author

Mikhail-Ivanou commented Jun 20, 2023

Yep, v1 -> v2 migration was done. And adapters are generated correctly
image

The most confusing is that https://github.com/GetDutchie/brick/tree/main/example_rest has similar issues for me

@tshedor
Copy link
Collaborator

tshedor commented Jun 21, 2023

@Mikhail-Ivanou I can reproduce. I'm not sure what's going on. Thanks for reporting; it may be a few days before I can get back to you.

@tshedor
Copy link
Collaborator

tshedor commented Jun 26, 2023

@Mikhail-Ivanou please upgrade brick_offline_first_with_rest_build to 3.1.0. I'm going to close this issue for now, but please comment on here if that hasn't resolved your problem and I'll reopen.

@tshedor tshedor closed this as completed Jun 26, 2023
@Mikhail-Ivanou
Copy link
Author

It works! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants