Skip to content

Xcode in macox 10.15 beta library code signature problem #15645

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
CaffeCat opened this issue Oct 5, 2019 · 29 comments
Closed

Xcode in macox 10.15 beta library code signature problem #15645

CaffeCat opened this issue Oct 5, 2019 · 29 comments

Comments

@CaffeCat
Copy link

CaffeCat commented Oct 5, 2019

This is the first time to use opencv at Mac OS. I used homebrew to install opencv in my Macbook, and all path search definitely correct in Xcode. I created a hello world in commandline tool project using C++ language not OBJC language. I could compile my opencv hello world, but it was broken in runtime, with showing the following logs:
=== logs ====
dyld: Library not loaded: /usr/local/opt/opencv/lib/libopencv_flann.4.1.dylib
Referenced from: /Users/weibinwu/Library/Developer/Xcode/DerivedData/OpenCV-frdcgrfkxsvbyahjaonnyllerinn/Build/Products/Debug/OpenCV
Reason: no suitable image found. Did find:
/usr/local/opt/opencv/lib/libopencv_flann.4.1.dylib: code signature in (/usr/local/opt/opencv/lib/libopencv_flann.4.1.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/lib/libopencv_flann.4.1.dylib: code signature in (/usr/local/lib/libopencv_flann.4.1.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/opencv/4.1.1_2/lib/libopencv_flann.4.1.1.dylib: code signature in (/usr/local/Cellar/opencv/4.1.1_2/lib/libopencv_flann.4.1.1.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.
== logs ===

please could somebody help me out of this problem?

@CaffeCat
Copy link
Author

CaffeCat commented Oct 5, 2019

截屏2019-10-0518 27 38

this is screenshot of logs.

@CaffeCat
Copy link
Author

CaffeCat commented Oct 5, 2019

I still waiting for your help, and really get confused on code signature >V<

@CaffeCat CaffeCat changed the title Xcode in macox 10.15 beta libary code signature problem Xcode in macox 10.15 beta library code signature problem Oct 5, 2019
@alalek
Copy link
Member

alalek commented Oct 5, 2019

macox 10.15 beta

Probably no support for that yet (we don't have these configurations).

/usr/local/Cellar/
homebrew

It is better to ask there about MacOSX signing issues. Or check Apple forums about 10.15 beta signatures.

@dev-yong
Copy link

dev-yong commented Oct 8, 2019

@CaffeCat I met same problem, and solved it using code sign
I just codesign all errors.
codesign -f -s "Mac Developer: YOURDEVELOPEREMAIL" /usr/local/opt/*/lib/*.dylib

@CaffeCat
Copy link
Author

CaffeCat commented Oct 8, 2019

@LeeGwangYong Thanks a lot! I will try after work.

@CaffeCat
Copy link
Author

CaffeCat commented Oct 8, 2019

@LeeGwangYong You are exactly right!!! It is useful to use your recommended command to code sign every error dylib file!

@CaffeCat CaffeCat closed this as completed Oct 8, 2019
@vivek-ram
Copy link

@LeeGwangYong hi bro i also have same problem but codesign -f -s "Mac Developer: YOURDEVELOPEREMAIL" /usr/local/opt//lib/.dylib is not working it is saying Mac developer not found can you please help me

@pedrofrodenas
Copy link

pedrofrodenas commented Nov 10, 2019

I have the same problem, I can compile opencv 4 project but when it comes to execute it throws those errors.
Executing this not solves the error
codesign -f -s "Mac Developer: MYDEVELOPEREMAIL" /usr/local/opt//lib/.dylib

Mac Developer: MYDEVELOPEREMAIL: no identity found

@vivek-ram
Copy link

@pedrofrodenas yeah exactly I don't know what to do. have you solved that error?

@pedrofrodenas
Copy link

@pedrofrodenas yeah exactly I don't know what to do. have you solved that error?

not yet. I don't know what to do

@vivek-ram
Copy link

@pedrofrodenas okay bro thanks 😊 let me know if u solved it thanks

@AnisimovArthur
Copy link

AnisimovArthur commented Nov 15, 2019

Hey,
I have the same problem with Vulkan.
I solved this by checking this box:

image

Hope it will help! 🙂

@pedrofrodenas
Copy link

Hey,
I have the same problem with Vulkan.
I solved this by checking this box:

image

Hope it will help! 🙂

yes it works, thanks!

@huangxiaojingCN
Copy link

@CaffeCat I met same problem, and solved it using code sign
I just codesign all errors.
codesign -f -s "Mac Developer: YOURDEVELOPEREMAIL" /usr/local/opt/*/lib/*.dylib

yet it works, thanks 👍👍

@Meriky
Copy link

Meriky commented Dec 18, 2019

I have this problem too, but I don't have a developer account
and I finally solved this by removing the default git of mac and using git from homebrew

#remove /usr/bin/git
brew install git

@jimgeldermann
Copy link

jimgeldermann commented Feb 1, 2020

Thanks - same problem with custom frameworks after I upgraded to Catalina. "Disable Library Validation" fixed the problem. xCode Version 11.2.1 (11B500)

@ShaneMatthias
Copy link

ShaneMatthias commented Feb 6, 2020

Hey,
I have the same problem with Vulkan.
I solved this by checking this box:

image

Hope it will help! 🙂

Hey, I don't have this option :/ Know why?

EDIT: Nevermind! I found it. I had to enable hardened runtime under Build Settings.

@KangWeon
Copy link

KangWeon commented Mar 10, 2020

codesign -f -s "Mac Developer: YOURDEVELOPEREMAIL" /usr/local/opt//lib/.dylib

when running above, if it would be error, replace "YOURDEVELOPEREMAIL" by "YOUR TEAM NAME".

@kakyoism
Copy link

kakyoism commented Mar 11, 2020

@CaffeCat I met same problem, and solved it using code sign
I just codesign all errors.
codesign -f -s "Mac Developer: YOURDEVELOPEREMAIL" /usr/local/opt/*/lib/*.dylib

Thanks. This helped me.
But in my case (macOS 10.14.6, Xcode 11.3.1), I had to use the identity found in keychain which happens to be like this "Apple Development: Firstname Surname (xxxxxxxxxx)".

@Anxdada
Copy link

Anxdada commented Mar 12, 2020

Hey,
I have the same problem with Vulkan.
I solved this by checking this box:

image

Hope it will help! 🙂

I meet this problem with SDL2, which has troubled me for a long time.
Thanks u. bro

@mohsinbmwm3

This comment has been minimized.

@panandafog

This comment has been minimized.

@degreesky
Copy link

Thank you!

@sreexamus
Copy link

I have the same problem on Xcode 11.4.1. ran the command "codesign -f -s "Mac Developer:" getting no identity error. I don't see the option of Disable Library validation on Xcode 11.4.1

@mohitTomar

This comment has been minimized.

@xmjiaming
Copy link

I have the same problem, I can compile opencv 4 project but when it comes to execute it throws those errors.
Executing this not solves the error
codesign -f -s "Mac Developer: MYDEVELOPEREMAIL" /usr/local/opt//lib/.dylib

Mac Developer: MYDEVELOPEREMAIL: no identity found

@pedrofrodenas yeah exactly I don't know what to do. have you solved that error?

I have the same problem on Xcode 11.4.1. ran the command "codesign -f -s "Mac Developer:" getting no identity error. I don't see the option of Disable Library validation on Xcode 11.4.1

Please use command security find-identity to find out the exact one's own identity.

@StevenACoffman
Copy link

StevenACoffman commented Jul 10, 2021

If you are developing or compiling the binaries yourself, you can generate a self-signed certificate by accessing Keychain Access > Certificate Assistant > Create Certificate -> Certificate Type: Code Signing. You can then sign your binary with:

codesign -f --sign <Name of certificate created above> /usr/local/opt/*/lib/*.dylib

However, I don't think that these will work unless you have an Apple Developer account.

MarquisLP added a commit to MarquisLP/world-scribe-2-desktop that referenced this issue Jul 18, 2021
@BITQinDynasty
Copy link

Hey, I have the same problem with Vulkan. I solved this by checking this box:

image

Hope it will help! 🙂

works for me, thanks!

@Dimisz
Copy link

Dimisz commented Oct 30, 2021

Hey, I have the same problem with Vulkan. I solved this by checking this box:

image

Hope it will help! 🙂

Worked for me in Nov 2021. Thanks a lot!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests