Forum > macOS / Mac OS X

How to load dylib for fpwebview demos?

<< < (2/2)

Cascade:
Oh wow - thank you. I have just downloaded a zip of the master branch.


--- Quote ---Build the app by running macbuild.sh and macpostbuild.sh in turn. Curiously I wasn't able to build the app from within Lazarus (3.6) IDE, to be investigated.
--- End quote ---

Interestingly, I had the opposite problem: OK building the lclembed app from within the Lazarus IDE (3.99) - but not via macbuild.sh (lazbuild not found).

This one definitely gets further - and gives an informative error message.  The issue is looking like security on my system.  The dylib is not loading because the developer can't be verified (screenshot attached).

I had a go at building the web view dylib myself, hoping my system would then accept it, but the resulting dylib is only 16KB - so I think I got something wrong there.

Cascade:
When running from terminal (not using the app bundle) I now get more detailed information about the issue:


--- Code: ---/Users/ … /FPWebView/demo/lclembed/lclembed ; exit;
dyld: Library not loaded: @executable_path/libwebview.dylib
  Referenced from: /Users/ … /FPWebView/demo/lclembed/lclembed
  Reason: no suitable image found.  Did find:
/Users/ … /FPWebView/demo/lclembed/libwebview.dylib: code signature in (/Users/ … /FPWebView/demo/lclembed/libwebview.dylib) not valid for use in process using Library Validation: library load disallowed by system policy
/Users/ … /FPWebView/demo/lclembed/libwebview.dylib: stat() failed with errno=1

--- End code ---

TRon:
Error 1 = EPERM (permission error)

Something seems off in either the application bundle (signing) or an overall policy (might be as simple as library located in the wrong place e.g. library not allowed to be loaded from that location).

iow, I have no idea of the cause and how to approach as I lack the knowledge.

Cascade:
Thanks TRon - it's good to know what that error code means.

I wonder whether I need to add some kind of permission to the plist.info file in the app bundle?


--- Code: ---libwebview.dylib: code signature ... not valid for use in process using Library Validation: library load disallowed by system policy
--- End code ---

That message looks particularly significant.  Either the system doesn't like the code signature that is on the dylib file, or maybe it isn't currently signed, so the system refuses to load the library?

I found some related information, which seems to indicate a kind of workaround, by granting the app an entitlement to bypass Library Validation - but I don't fully understand it, nor the risks or implications.  Here's a link in case it helps shed some light:

Apple Developer - Entitlement to disable library validation

Navigation

[0] Message Index

[*] Previous page

Go to full version