objectbox / objectbox-dart-performance

Flutter App benchmarking the performance of ObjectBox against others (e.g. sqflite, Hive).
https://objectbox.io/
10 stars 8 forks source link

`flutter build bundle` fails on Linux #8

Closed jwinarske closed 2 years ago

jwinarske commented 2 years ago

OS: Ubuntu 20 Flutter Embedder: ivi-homescreen

Flutter Version

$ flutter --version
Flutter 2.10.5 • channel stable • https://github.com/flutter/flutter
Framework • revision 5464c5bac7 (3 weeks ago) • 2022-04-18 09:55:37 -0700
Engine • revision 57d3bac3dd
Tools • Dart 2.16.2 • DevTools 2.9.2

Flutter Config

Settings:
  enable-linux-desktop: false
  enable-custom-devices: true (Unavailable)

flutter pub run build_runner build passes without error

flutter build bundle fails with:

💪 Building with sound null safety 💪

lib/isar.g.dart:160:35: Error: Too few positional arguments: 5 required, 0 given.
    final object = TestEntityPlain();
                                  ^
lib/model.dart:51:3: Context: Found this candidate, but the arguments don't match.
  TestEntityPlain(this.id, this.tString, this.tInt, this.tLong, this.tDouble);
  ^^^^^^^^^^^^^^^
lib/isar.g.dart:236:37: Error: Too few positional arguments: 5 required, 0 given.
    final object = TestEntityIndexed();
                                    ^
lib/model.dart:96:3: Context: Found this candidate, but the arguments don't match.
  TestEntityIndexed(this.id, this.tString, this.tInt, this.tLong, this.tDouble);
  ^^^^^^^^^^^^^^^^^
lib/isar.g.dart:301:35: Error: Too few positional arguments: 2 required, 0 given.
    final object = RelTargetEntity();
                                  ^
lib/model.dart:241:3: Context: Found this candidate, but the arguments don't match.
  RelTargetEntity(this.id, this.name);
  ^^^^^^^^^^^^^^^
Target kernel_snapshot failed: Exception
Failed to build bundle.

What is the required patch for isar.g.dart?

jwinarske commented 2 years ago

Required changes to lib/isar.g.dart in order to build: final object = TestEntityPlain(); to final object = TestEntityPlain.forIsar(); final object = TestEntityIndexed(); to final object = TestEntityIndexed.forIsar(); final object = RelTargetEntity(); to final object = RelTargetEntity.forIsar();

greenrobot-team commented 2 years ago

@jwinarske This is also documented in the README. (But once updated to the current isar release, this should no longer be necessary.)