Xcode 16 编译弹窗问题、编译通过无法,编译通过打包等问题汇总

问题1:打包的过程中不断提示 :codesign 想要访问你的钥匙串中的密钥"develop 或者distribution 证书"

解决:打开钥匙串,点击证书---显示简介---信任----改为始终信任

(记住 :不能只修改钥匙的显示简介的 访问控制,没有用)

问题2:钥匙串访问.app 已经损坏 或者 钥匙串访问.app无法打开 或者 钥匙串访问.app找不动

解决:在隐私和安全性里,点击 "仍要打开";如果没有重启 电脑找到钥匙串;如果没有钥匙串,

前往:

/System/Library/CoreServices/Applications

拖出来,或者制作一个替身;

问题3:预编译提示---警告:无法为签名者"苹果开发:开发者名字(JG389S296G)"构建自签名根的链

note: Signing static framework with --generate-pre-encrypt-hashes (in target '你的项目名称'' from project '你的项目名称')

Warning: unable to build chain to self-signed root for signer "Apple Development: Shuai Wei (JG389S296G)"

/Users/weishuai/Library/Developer/Xcode/DerivedData/你的项目名称-amtrscihdrqmjvdfdywztyucfvby/Build/Products/Debug-iphoneos/你的项目名称'.framework: errSecInternalComponent

Command CodeSign failed with a nonzero exit code

****检查钥匙串中的是否有AppleWWDRCA 证书等;(注意!这两个证书 不要选择"始终信任",和开发者证书不一样!!!)

*****如果有这些证书,请删除后,重新下载 :下载链接https://link.csdn.net/?target=https://links.jianshu.com/go?to=https://www.apple.com/certificateauthority/AppleWWDRCAG3.cer *****下载的证书样式如下:

下载AppleWWDRCA证书参考链接:iosxcode运行报错解决方案Warning: unable to build chain to self-signed root for signer "Apple Develop xxxxxx-CSDN博客

(注意,如果你不仅仅缺少这些证书,而是都缺少,而且你也不知道缺少啥,请下载下面的所有证书)

如果 Worldwide Developer Relations 中间关系证书缺失,我们需要将相关所有证书下载并导入到「系统」级钥匙串:

首先访问网站:https://www.apple.com/certificateauthority

下载右侧 Apple Intermediate Certificates 下方的如下证书(最好右侧证书都下载一遍,下载后每个都要双击一下,确保安装)

Developer Authentication

Worldwide Developer Relations - G2

Worldwide Developer Relations - G3

Worldwide Developer Relations - G4

Worldwide Developer Relations - G5

Worldwide Developer Relations - G6

Worldwide Developer Relations - G7

Worldwide Developer Relations - G8

都下载完成后,大概如下这么多:

然后,打开「钥匙串」,选中左侧的「系统」(System)并右键选择 解锁:

下载所有证书参考链接:

macOS 中 Apple Distribution 与 Apple Development 证书不受信任解决方法_iphonedistribution未受信任-CSDN博客

//---------------------------最后的最后---------------------------

*****如果TM的还报错,类似如下:(这是最蛋疼的问题,它的意思是你啥问题没有 就是无法输出,归根到底还是证书的问题,请重启Xcode,或者重启电脑,如果你的项目里包含你的SDK,退出重新进入后,请先预编译你的SDK,然后预编译你的项目)

error: The command `(cd /Users/weishuai/Desktop/DR/NEW_VendorDKProject && env 'CA_ASSERT_MAIN_THREAD_TRANSACTIONS=1' 'CA_DEBUG_TRANSACTIONS=1' 'CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate' 'COMMAND_MODE=unix2003' 'DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer' 'HOME=/Users/weishuai' 'LD_LIBRARY_PATH=/Applications/Xcode.app/Contents/Developer/../SharedFrameworks/' 'LOGNAME=weishuai' 'PATH=/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin' 'SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.2.sdk' 'SHELL=/bin/zsh' 'SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.GPApLCwbZL/Listeners' 'TMPDIR=/var/folders/jh/gp4_tnj50493_sdsql8fqqbm0000gn/T/' 'USER=weishuai' 'UsePerConfigurationBuildLocations=YES' 'XPC_FLAGS=0x0' 'XPC_SERVICE_NAME=application.com.apple.dt.Xcode.8426987.8575133' '__CFBundleIdentifier=com.apple.dt.Xcode' '__CF_USER_TEXT_ENCODING=0x1F5:0x19:0x34' /usr/bin/codesign --force --sign B16E6C19DF750CE2D63389AE749E901CD927403F --verbose /Users/weishuai/Library/Developer/Xcode/DerivedData/NEWVendorDKApp-ellnlbpexirjfhdrfhvyoisusomj/Build/Products/Debug-iphoneos/DKTarget.app/Frameworks/libswiftCoreFoundation.dylib)` exited with status 0. The command's output was:

/Users/weishuai/Library/Developer/Xcode/DerivedData/NEWVendorDKApp-ellnlbpexirjfhdrfhvyoisusomj/Build/Products/Debug-iphoneos/DKTarget.app/Frameworks/libswiftCoreFoundation.dylib: replacing existing signature

******如果还是不行,报错还是下面的错误:请Clean Builder Folder 一下

如果 command +B 预编译,又出现了如下错误: 请重新下载根证书(步骤如上);

note: Signing static framework with --generate-pre-encrypt-hashes (in target '你的项目名称'' from project '你的项目名称')

Warning: unable to build chain to self-signed root for signer "Apple Development: Shuai Wei (JG389S296G)"

/Users/weishuai/Library/Developer/Xcode/DerivedData/你的项目名称-amtrscihdrqmjvdfdywztyucfvby/Build/Products/Debug-iphoneos/你的项目名称'.framework: errSecInternalComponent

Command CodeSign failed with a nonzero exit code

如果还是报错,请删除你的开发者证书:develop 和distribution 证书,然后在 signing &&Revoker certificate(吊销证书)后重新生成证书;

*****如果又报错如下:(这是最蛋疼的问题,它的意思是你啥问题没有 就是无法输出,归根到底还是证书的问题,请重启Xcode,如果你的项目里包含你的SDK,退出重新进入后,请先预编译你的SDK,然后预编译你的项目)

error: The command `(cd /Users/weishuai/Desktop/DR/NEW_VendorDKProject && env 'CA_ASSERT_MAIN_THREAD_TRANSACTIONS=1' 'CA_DEBUG_TRANSACTIONS=1' 'CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate' 'COMMAND_MODE=unix2003' 'DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer' 'HOME=/Users/weishuai' 'LD_LIBRARY_PATH=/Applications/Xcode.app/Contents/Developer/../SharedFrameworks/' 'LOGNAME=weishuai' 'LaunchInstanceID=398BF1B5-0E80-4ECE-8792-F6B96811490E' 'PATH=/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin' 'SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.2.sdk' 'SECURITYSESSIONID=186a3' 'SHELL=/bin/zsh' 'SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.qXwq2ma6tH/Listeners' 'TMPDIR=/var/folders/jh/gp4_tnj50493_sdsql8fqqbm0000gn/T/' 'USER=weishuai' 'UsePerConfigurationBuildLocations=YES' 'XPC_FLAGS=0x0' 'XPC_SERVICE_NAME=application.com.apple.dt.Xcode.8426987.8575133' '__CFBundleIdentifier=com.apple.dt.Xcode' '__CF_USER_TEXT_ENCODING=0x1F5:0x19:0x34' /usr/bin/codesign --force --sign D65250552561F4175744F0DBDB76C42C52139193 --verbose /Users/weishuai/Library/Developer/Xcode/DerivedData/NEWVendorDKApp-ellnlbpexirjfhdrfhvyoisusomj/Build/Products/Debug-iphoneos/DKTarget.app/Frameworks/libswiftCore.dylib)` exited with status 0. The command had no output. (in target 'DKTarget' from project 'NEWVendorDKApp')

//------------到这里就是终极办法了,可以先用-----------

如果依然出错,修改Bundle Identifier 的 名字:后面加个01: Bundle 名称+01,编译,然后再改回来。

相关推荐
Black_Rock_br1 小时前
Mac监控新风尚:酷炫界面,性能监控更直观!
运维·macos
humiaor4 小时前
Xcode为不同环境配置不同的环境变量
ide·macos·xcode·xcode多环境·user-defined
冯浩(grow up)9 小时前
macOS可视化桌面配置docker加速器
macos·docker·容器
Micheal_Dad10 小时前
在macOS的docker中如何安装及运行ROS2
macos·docker
Jodie_Rao13 小时前
在 M1 芯片的 Mac 电脑上安装 Redis 可以通过 Homebrew 快速完成
数据库·redis·macos
TimeDoor15 小时前
整理我的macos的复杂混乱的python环境
开发语言·python·macos
哈哈哈哈哈哈哈哈哈...........21 小时前
【软件】在 macOS 上安装和配置 Apache HTTP 服务器
http·macos·apache
匆匆z21 天前
从 macos 切换到 windows 上安装的工具类软件
windows·macos·工具
czhc11400756631 天前
网络2 IP与MAC IP地址
网络·tcp/ip·macos
LVGRAPE1 天前
rtthread 软件SPI驱动, 支持mode0~3,MSB,LSB
macos·objective-c·cocoa