I had the identical problem trying to use dylibs installed by Mac Ports. At runtime dylib wouldn't load the dylibs, saying: "code signature in '/opt/local/lib/opencv3/libopencv_shape.3.4.16.dylib' not valid for use in process: mapped file has no Team ID and is not a platform binary."
The solution for me was to disable "Enable Hardened Runtime", which had been set to YES.
Topic:
Code Signing
SubTopic:
General
Tags: