An empty identity is not valid when signing a binary for the product type 'Dynamic Library'
现象
M2 Max Mac + Xcode 14.3.1中,新建iOSOpenDev项目,去Build编译,报错:
An empty identity is not valid when signing a binary for the product type 'Dynamic Library'
拷贝出的详细错误信息:
Build target HookWhatsApp of project HookWhatsApp with configuration Debug
error: An empty identity is not valid when signing a binary for the product type 'Dynamic Library'. (in target 'HookWhatsApp' from project 'HookWhatsApp')
...
An empty identity is not valid when signing a binary for the product type 'Dynamic Library'.

原因
- 不是很清楚
- 只是大概知道,属于Xcode的自动管理codesign签名方面的问题
解决办法
- 思路1:禁用自动签名
- 思路2:给
identity设置某个合适的值(这样就不是empty空了)
具体步骤
思路1:禁用自动签名
Xcode->PROJECT->{YourProjectName}->Build Settings->User-Defined->- (点击左上角的
加号=➕->Add User-Defined Setting) - 新增选项:
CODE_SIGNING_ALLOWED=NO - 额外说明
- 如果还不行,多试几次Clean:
Xcode->Product->Clean Build FoldersXcode->Product->Clean All Issues
- 如果还不行,多试几次Clean:
- (点击左上角的
思路2:给Identity设置某个合适的值
Xcode->TARGETS->{YourProjectName}->Build Settings->Signing- 设置相关参数值
Code Sign Identity设置为:(Automatic中的)Apple DevelopmentDevelopment Team设置为:你自己的Apple开发者账号 = 此处是:Mao Li
- 效果图
- 设置相关参数值
不要设置Code Sign Identity为Apple Development: xxx
此处之前设置了:
Xcode->TARGETS->{YourProjectName}->Build Settings->Signing->Code Sign Identity->设置为(Certificates in Keychain中的)Apple Development: Mao Li (UBFSP2P5PM)
结果会报错:
/Users/crifan/dev/dev_root/crifan/github/iOSOpenDevHookTemplate/iOSOpenDevHookTemplate/iOSOpenDevHookTemplate.xcodeproj iOSOpenDevHookTemplate has conflicting provisioning settings. iOSOpenDevHookTemplate is automatically signed, but code signing identity Apple Development: Mao Li (UBFSP2P5PM) has been manually specified. Set the code signing identity value to "Apple Development" in the build settings editor, or switch to manual signing in the Signing & Capabilities editor.

然后改为上面说的(Automatic中的)Apple Development,才彻底解决了此处报错的问题。



