MacOS Loading Dynamic Library dylib Report "Code signature Invalid" error solution

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.