2

After successfully notarizing my app around a dozen times and it working just fine, it now goes through notarization without a hitch and then crashes on launch with:

Dyld Error Message:
  Library not loaded: @loader_path/../Frameworks/ShortcutRecorder.framework/Versions/A/ShortcutRecorder
  Referenced from: /Applications/Vitamin-R 3.app/Contents/MacOS/Vitamin-R 3
  Reason: no suitable image found.  Did find:
    /Applications/Vitamin-R 3.app/Contents/MacOS/../Frameworks/ShortcutRecorder.framework/Versions/A/ShortcutRecorder: code signing blocked mmap() of '/Applications/Vitamin-R 3.app/Contents/MacOS/../Frameworks/ShortcutRecorder.framework/Versions/A/ShortcutRecorder'
    /Applications/Vitamin-R 3.app/Contents/MacOS/../Frameworks/ShortcutRecorder.framework/Versions/A/ShortcutRecorder: code signing blocked mmap() of '/Applications/Vitamin-R 3.app/Contents/MacOS/../Frameworks/ShortcutRecorder.framework/Versions/A/ShortcutRecorder'
    /Applications/Vitamin-R 3.app/Contents/MacOS/../Frameworks/ShortcutRecorder.framework/Versions/A/ShortcutRecorder: stat() failed with errno=1
    file system relative paths not allowed in hardened programs

Thing is I'm not sure where exactly the runtime path for a framework is determined.. I keep the framework in ~/Libary/Frameworks/ on my development machine, but then it's copied into the app bundle and I'm not quite sure what determines the path at runtime..

Any help would be appreciated.

Frank R.
  • 2,328
  • 1
  • 24
  • 44

2 Answers2

0

This could be a codesign certificate issue... Fix it by:

Open Keychain Access: My Certificates > "Right Click" Certificate > get info > Trust > When using this certificates > Use System Defaults

Richard Barber
  • 5,257
  • 2
  • 15
  • 26
  • Thanks for the suggestion. Unfortunately, it's not that. The certificate already used the system defaults.. I think there must be some kind of translation process between where the framework is at build time and where it is at runtime.. – Frank R. Oct 18 '19 at 15:14
  • Aha, did getting rid of the relative path help any? Using `install_name_tool` the runtime path can be changed. – Richard Barber Oct 23 '19 at 14:05
0

I had exactly the same issue. The solution was to add the framework to the 'Copy Files' build step as well. There you can define the destination to 'Frameworks'.

Marius
  • 258
  • 1
  • 9
  • I ended up just getting rid of the framework, which is a fairly radical "fix". – Frank R. May 20 '20 at 07:32
  • I'm 99% certain that I was already copying the framework in the Copy Files step as that is my standard setup. It's probably more of an issue of having a project that was originally created twenty years ago and has been migrated so often.. – Frank R. May 20 '20 at 07:33