Open venkat9507 opened 1 month ago
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
)
thank you for reproducing it
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 currentanalyzer
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 runningflutter 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