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

Example file is not running event management tutorial ---> many-to-many #687

Open
venkat9507 opened this issue Oct 16, 2024 · 2 comments
Open
Labels
bug Something isn't working

Comments

@venkat9507
Copy link

Cannot build runner for event management tutorial many-to-many

user@user-Mac-mini many_to_many % fvm dart pub run build_runner build
Deprecated. Use dart run instead.
[INFO] Generating build script completed, took 172ms
[INFO] Reading cached asset graph completed, took 171ms
[INFO] Checking for updates since last build completed, took 656ms
[WARNING] objectbox_generator:resolver on lib/main.dart:
Your current analyzer version may not fully support your current SDK version.

Analyzer language version: 3.2.0
SDK language version: 3.5.0

Please update to the latest analyzer version (6.11.0) by running
flutter packages upgrade.

If you are not getting the latest version by running the above command, you
can try adding a constraint like the following to your pubspec to start
diagnosing why you can't get the latest version:

dev_dependencies:
analyzer: ^6.11.0

[SEVERE] objectbox_generator:generator on lib/$lib$:

Unknown relation backlink source for 'Owner.tasks'
[INFO] Running build completed, took 7.3s
[INFO] Caching finalized dependency graph completed, took 147ms
[SEVERE] Failed after 7.4s

ERROR:

[SEVERE] objectbox_generator:generator on lib/$lib$:
Unknown relation backlink source for 'Owner.tasks'

I will try to solve this and give PR

@venkat9507 venkat9507 added the bug Something isn't working label Oct 16, 2024
@venkat9507 venkat9507 mentioned this issue Oct 20, 2024
@greenrobot-team
Copy link
Member

greenrobot-team commented Oct 21, 2024

Thanks for reporting, I could reproduce this!

A workaround for this it to modify the ToMany in the Owner class to explicitly specify the Backlink source:

  @Backlink('owner')
  final tasks = ToMany<Task>();

As there is only one matching source relation, the generator should be able to choose the right one. So this might be a bug in the generator. We should investigate.

(Internal issue objectbox/objectbox-dart#125)

@venkat9507
Copy link
Author

venkat9507 commented Oct 28, 2024

thank you for reproducing it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants