sunlubo / SwiftFFmpeg

A Swift wrapper for the FFmpeg API
Apache License 2.0
521 stars 83 forks source link

Library validation error #49

Closed petarbelokonski closed 3 years ago

petarbelokonski commented 3 years ago

Hi I am new to this world.

This is the error I receive when I am trying to run a command line executable made from command line app with XCode. I have added SwiftFFmpeg via SPM to my project. Any help pls ?

Petars-MacBook-Pro:Debug petar$ ./CurrentCL
dyld: Library not loaded: /usr/local/opt/ffmpeg/lib/libavformat.58.dylib
  Referenced from: /Users/petar/Library/Developer/Xcode/DerivedData/CurrentCL-flrgocsozeiodqbnwewazwdyydnb/Build/Products/Debug/./CurrentCL
  Reason: no suitable image found.  Did find:
    /usr/local/opt/ffmpeg/lib/libavformat.58.dylib: code signature in (/usr/local/opt/ffmpeg/lib/libavformat.58.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
    /usr/local/opt/ffmpeg/lib/libavformat.58.dylib: stat() failed with errno=1
    /usr/local/lib/libavformat.58.dylib: code signature in (/usr/local/lib/libavformat.58.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
    /usr/local/Cellar/ffmpeg/4.3.1_9/lib/libavformat.58.45.100.dylib: code signature in (/usr/local/Cellar/ffmpeg/4.3.1_9/lib/libavformat.58.45.100.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
Abort trap: 6

PS: for the record I get the same error if adding the framework to a UI app. I guess there is an issue with my ffmpeg install - I have it installed with homebrew 🤷🏼‍♀️

petarbelokonski commented 3 years ago

For anyone wondering I solved my issue by finding this