美文网首页
Failed to load dynamic library

Failed to load dynamic library

作者: 居家杂谈 | 来源:发表于2020-10-16 17:03 被阅读0次

dart ffi 的 helloworld sample 跑不起来

Unhandled exception:

Invalid argument(s): Failed to load dynamic library (dlopen(./hello_library/libhello.dylib, 1): no suitable image found.  Did find:

        file system relative paths not allowed in hardened programs)

#0      _open (dart:ffi-patch/ffi_dynamic_library_patch.dart:11:55)

#1      new DynamicLibrary.open (dart:ffi-patch/ffi_dynamic_library_patch.dart:20:12)

#2      main (file:///Users/chenjiangfeng/github/dart-samples/ffi/hello_world/hello.dart:18:36)

#3      _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:301:19)

#4      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)

签名问题。

dart sdk已经签名了,要调用dylib,被调用的dylib需要跟dart同签名才行,但你又没有dart sdk的签名。

解决方法:清除dart sdk的签名

codesign --remove-signature`which dart`

相关文章

网友评论

      本文标题:Failed to load dynamic library

      本文链接:https://www.haomeiwen.com/subject/nuozpktx.html