7

I've run into

dyld: could not load inserted library '/usr/local/lib/dgagent/libpreload.dylib' because no suitable image found.  Did find:
    file system sandbox blocked open() of '/usr/local/lib/dgagent/libpreload.dylib'

error with several applications - svnX (while trying to import directory, for example), SnailSVN (while trying to run Test during setup). Seems like this file system sandbox blocked open() therefore is not application specific but rather my Mac is missing some settings.

Have anyone encountered the same issue and found the way around it?

Blazej SLEBODA
  • 8,936
  • 7
  • 53
  • 93
user2156173
  • 143
  • 1
  • 5

4 Answers4

4

On 10.15 and later, folders like the Desktop, Documents etc. require "Files and Folders access"

Two steps to setup the access:

  1. System Preferences > Security & Privacy > Privacy > Full Disk Access > "add your app such as svnX"

  2. System Preferences > Security & Privacy > Privacy > Files and Folders > "add your app such as svnX"

machnic
  • 2,304
  • 2
  • 17
  • 21
2

The comment from Richard Barber above saved my life. I also faced this issue (although with a different app and a different library) but essentially the same thing. Apple apps run is something called a Sandbox and hence cannot access a lot of locations. I tried adding the access to "Full Disk" and "Files and Folders" as specified in the above answer. I was able to add "Full Disk Access" but the "Files and Folder" thing was greyed out on my app in question (Microsoft Excel). So, that didn't work for me

Finally what worked is taking the entire folder of the library in question (in my case a mysql odbc driver) and copying it over to /Applications/Microsoft Excel.app/Contents/Frameworks/

TL;DR : copy the library in question over to the Frameworks folder in the directory of that application and then the application should be able to access it

0

Richard Barber's comment is the correct answer.

For Example, if you have an app called SomeApp and it needs a library installed by Homebrew then the solution would be

cd /Applications/SomeApp/Contents/Frameworks
ln -s /opt/homebrew/Cellar/some-lib/lib/some.lib.dylib

This will install the library for the application to use

If SomeApp is hardcoded to use /usr/local/lib then, you need to do the following

sudo su -
cd /System/Volumes/Preboot/Cryptexes/OS/usr/lib/
cp /opt/homebrew/Cellar/some-lib/lib/some.lib.dylib .

Then, log out, and when you log back in, the app should work

Kearney Taaffe
  • 647
  • 8
  • 20
-2

This is a restriction commonly seen with Apple Gatekeeper on Hardened runtime. This has increased with MacOS catalina pushing for notarized applications.