I. Description of the phenomenon
There has been a period of development on MacOS, and a certain amount of experience has been accumulated. However, a problem was encountered today when replacing a dynamic library in the project. The original project used a static library, debugging and found that there is a problem to replace it into a dynamic library. It would have been nothing to say, but after the project was compiled, the package test found that no matter how the program is loaded. There is no doubt that this is a problem with the newly replaced dynamic library.
Ii. Solutions
So try opening the log file to see what you found:
According to the above log file hint, the dynamic library load failed. The reason for this is:code signature Invalid. This is odd a strange, have not encountered a similar problem before AH. And this dynamic library is still copied from other projects, never found the problem ah. Since the signature is not valid, then use the command to see the signature status again:
As you can see, the signature of thelibexpat.1.dylib file is indeed invalid. may have been modified or other reasons have caused it. and libexiv2.14.dylib This file is not signed. Since the code signature of the dynamic library is not valid, then we have a bold idea to try to re-sign the dynamic library:
All dependent libraries are signed, repackaged, and the problem is gone. However, why in the other project to use the perfect operation, in this project, but reported the code signature invalidation, this is not figured out.
Third, reference links
1. https://forum.unity3d.com/threads/invalid-signature-for-submitted-mac-app.120263/
2. https://github.com/XVimProject/XVim/issues/971
3. https://knowledge.autodesk.com/search-result/caas/sfdcarticles/sfdcarticles/ Code-signature-invalid-error-when-launching-product-on-os-x.html
MacOS Loading Dynamic Library dylib Report "Code signature Invalid" error solution