1 | initial version |
In case some unfortunate soul stumbles upon this thread in the future, be content that I have found a solution.
The issue is with code signing, so to solve it, you can sign the code. Use the following command in Terminal:
codesign -f -s "Your Email" /usr/local/opt/opencv/lib/libopencv_gapi.4.3.dylib
Don't just copy it though, put in your email and make sure the library and version number is correct. Use the file path Xcode spits out at you in the error message, which for OP was /usr/local/Cellar/opencv/4.1.2/lib/libopencv_gapi.4.1.2.dylib
. Use the command for each of the file paths Xcode is complaining about.
If, when you use that, codesign hits you with that no identity found
, do not despair. At that point, I gave up doing it the pretty way, and just disabled library validation in Xcode. This can be done by going to your development target in Xcode, and under 'Signing and Capabilities' and 'All', in the section 'Hardened runtime', checking the box named 'Disable Library Validation'. Apple likes to move things around, so if you can't find the setting there, look around for a bit or Google it.