-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
1 - XS (<= 1 day)
-
1619
What happened?
I'm encountering persistent errors when attempting to run unit tests. Following an upgrade to Realm 2.0.0, the tests fail to execute, consistently yielding the following error:
Realm error : Invalid argument(s): Failed to load dynamic library 'librealm_dart.dylib': dlopen(librealm_dart.dylib, 0x0001): tried: 'librealm_dart.dylib' (no such file), ... LateInitializationError: Local 'realm' has not been initialized. dart:_internal LateError._throwLocalNotInitialized
This issue seems to recur with every Realm upgrade, but previously, I managed to resolve it. Could you please provide guidance on how to address this error? Additionally, I would greatly appreciate any advice on best practices for upgrading Realm in a manner that does not affect unit tests (increasing the version in pubspec.yaml usually breaks unit tests).
Repro steps
flutter test
Version
3.3.3/3.19.5
What Atlas Services are you using?
Local Database only
What type of application is this?
Flutter Application
Client OS and version
macOS 14.2.1
Code snippets
void main() {
late Realm realm;
test("Open a local realm", ()
{ realm = Realm(Configuration.local([Car.schema])); expect(realm.isClosed, isFalse); });
tearDown(()
{ realm.close(); });
}
Stacktrace of the exception/crash you're getting
No response
Relevant log output
Realm error : Invalid argument(s): Failed to load dynamic library 'librealm_dart.dylib': dlopen(librealm_dart.dylib, 0x0001): tried: 'librealm_dart.dylib' (no such file), ... LateInitializationError: Local 'realm' has not been initialized. dart:_internal LateError._throwLocalNotInitialized