realm/realm-dart

_openRealmLib fails for dart compile to exe

nielsenko opened this issue · 1 comments

Compiling a dart app dependent on realm_dart, and copying it outside the project directory, will fail to load shared library, even when it is placed correctly on the path.

./myapp.exe
Unhandled exception:
Bad state: Could not find package_config.json
#0      _getPackageConfigJson (package:realm_dart/src/handles/native/init.dart:78)
#1      _openRealmLib (package:realm_dart/src/handles/native/init.dart:114)
#2      initRealm (package:realm_dart/src/handles/native/init.dart:157)
#3      realmLib.<anonymous closure> (package:realm_dart/src/handles/native/realm_library.dart:16)
#4      realmLib (package:realm_dart/src/handles/native/realm_library.dart:25)
#5      new ConfigHandle.from.<anonymous closure> (package:realm_dart/src/handles/native/config_handle.dart)
#6      using (package:ffi/src/arena.dart:124)
#7      new ConfigHandle.from (package:realm_dart/src/handles/native/config_handle.dart:26)
#8      new RealmHandle.open (package:realm_dart/src/handles/native/realm_handle.dart:46)
#9      Realm._openRealm (package:realm_dart/src/realm_class.dart:207)
#10     new Realm._ (package:realm_dart/src/realm_class.dart:143)
#11     new Realm (package:realm_dart/src/realm_class.dart:141)
#12     main (file:///Users/kasper/Projects/mongodb/realm-dart-samples/realm_dart/bin/myapp.dart:39)
#13     _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:295)
#14     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184)

Related to #1755

➤ PM Bot commented:

Jira ticket: RDART-1082