[英]IOS App Build issue: Command CodeSign failed with a nonzero exit code
I am trying to build my IOS app (developed using capacitor and ionic frameworks).我正在尝试构建我的 IOS 应用程序(使用电容器和离子框架开发)。 Just after integrating Google Firebase and adding Resources/GoogleService-Info.plist file I am having followng error while building my app in XCode.
在集成 Google Firebase 并添加 Resources/GoogleService-Info.plist 文件后,我在 XCode 中构建我的应用程序时遇到以下错误。
Command CodeSign failed with a nonzero exit code命令 CodeSign 失败,退出代码非零
CodeSign /Users/piyush/Library/Developer/Xcode/DerivedData/App-cfgpruswvcmgvpcxuzeyccwfgdyx/Build/Products/Debug-iphonesimulator/App.app (in target 'App' from project 'App')
cd /Users/piyush/Downloads/ncsmobileapp/ios/App
export CODESIGN_ALLOCATE\=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
Signing Identity: "-"
/usr/bin/codesign --force --sign - --entitlements /Users/piyush/Library/Developer/Xcode/DerivedData/App-cfgpruswvcmgvpcxuzeyccwfgdyx/Build/Intermediates.noindex/App.build/Debug-iphonesimulator/App.build/App.app.xcent --timestamp\=none --generate-entitlement-der /Users/piyush/Library/Developer/Xcode/DerivedData/App-cfgpruswvcmgvpcxuzeyccwfgdyx/Build/Products/Debug-iphonesimulator/App.app
/Users/piyush/Library/Developer/Xcode/DerivedData/App-cfgpruswvcmgvpcxuzeyccwfgdyx/Build/Products/Debug-iphonesimulator/App.app: code object is not signed at all
In subcomponent: /Users/piyush/Library/Developer/Xcode/DerivedData/App-cfgpruswvcmgvpcxuzeyccwfgdyx/Build/Products/Debug-iphonesimulator/App.app/AppIcon60x60@2x.png
Command CodeSign failed with a nonzero exit code
I tried cleaning the build cahce, restarting the xcode. re-building the app through capacitor, but nothig solved this issue yet.我尝试清理构建缓存,重新启动 xcode。通过电容器重新构建应用程序,但还没有解决这个问题。 Can anyone help in solving this issue?
任何人都可以帮助解决这个问题吗?
Update更新
While archiving the app following error occurs:归档应用程序时发生以下错误:
CodeSign /Users/piyush/Library/Developer/Xcode/DerivedData/App-cfgpruswvcmgvpcxuzeyccwfgdyx/Build/Intermediates.noindex/ArchiveIntermediates/App/InstallationBuildProductsLocation/Applications/App.app (in target 'App' from project 'App')
cd /Users/piyush/Downloads/ncsmobileapp/ios/App
export CODESIGN_ALLOCATE\=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
Signing Identity: "Apple Development: Piyush Aggarwal (ZWHGYV6A62)"
Provisioning Profile: "iOS Team Provisioning Profile: app.neo.school"
(d2353688-03d7-47ff-942f-4f34fd4c6a93)
/usr/bin/codesign --force --sign 5FE6CDFE4B615D56B70C5DAEB7A151005A1122AE --entitlements /Users/piyush/Library/Developer/Xcode/DerivedData/App-cfgpruswvcmgvpcxuzeyccwfgdyx/Build/Intermediates.noindex/ArchiveIntermediates/App/IntermediateBuildFilesPath/App.build/Release-iphoneos/App.build/App.app.xcent --generate-entitlement-der /Users/piyush/Library/Developer/Xcode/DerivedData/App-cfgpruswvcmgvpcxuzeyccwfgdyx/Build/Intermediates.noindex/ArchiveIntermediates/App/InstallationBuildProductsLocation/Applications/App.app
/Users/piyush/Library/Developer/Xcode/DerivedData/App-cfgpruswvcmgvpcxuzeyccwfgdyx/Build/Intermediates.noindex/ArchiveIntermediates/App/InstallationBuildProductsLocation/Applications/App.app: code object is not signed at all
In subcomponent: /Users/piyush/Library/Developer/Xcode/DerivedData/App-cfgpruswvcmgvpcxuzeyccwfgdyx/Build/Intermediates.noindex/ArchiveIntermediates/App/InstallationBuildProductsLocation/Applications/App.app/AppIcon60x60@2x.png
Command CodeSign failed with a nonzero exit code
Please try to delete the derived data and clean the build.请尝试删除派生数据并清理构建。
Steps to delete derived data:-删除派生数据的步骤:-
1.Open your project,Go to files -> Workspace Settings 1.打开你的项目,Go到文件->工作区设置
Then you will find a derived data location with an arrow:-然后你会发现一个带有箭头的派生数据位置:-
Just click on that arrow,after that you will find a folder named derived data, delete all the files inside derived data folder.只需单击该箭头,之后您会找到一个名为派生数据的文件夹,删除派生数据文件夹中的所有文件。 Then it will working fine.
然后它将正常工作。
I had almost the same exact issue and this was what finally worked for me after several hours of trying things.我遇到了几乎完全相同的问题,经过几个小时的尝试,这最终对我有用。
The issue was due to resources folder.问题是由于资源文件夹。 I created that folder to add my GoogleServices-Info.plist file.
我创建了那个文件夹来添加我的 GoogleServices-Info.plist 文件。
I renamed my resources folder and changaed the path to my GoogleServices-Info.pllist file by following code in build phrases of the app in xcode:我重命名了我的资源文件夹,并通过在 xcode 中应用程序的构建短语中的以下代码更改了我的 GoogleServices-Info.pllist 文件的路径:
PATH_TO_GOOGLE_PLISTS="${PROJECT_DIR}/App/[FOLDER NAME]"
cp -r "$PATH_TO_GOOGLE_PLISTS/GoogleService-Info.plist" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist" ;
I have the same (random) issue when Archiving project where OneSignal (specifically OneSignalNotificationServiceExtension
) framework is included.我在存档包含 OneSignal(特别是
OneSignalNotificationServiceExtension
)框架的项目时遇到相同的(随机)问题。 What I have to do to make it work (w00t) is to change KeyChain
Trust
setting on Apple Worldwide Developer Relations Certification Authority
(Expires: Tuesday, 7 February 2023 at 22:48:47 Central European ) certificate back to Use System Defaults
and then again back to Always Trust
.我必须做的让它工作 (w00t) 是将
Apple Worldwide Developer Relations Certification Authority
(Expires: Tuesday, 7 February 2023 at 22:48:47 Central European) 证书上的KeyChain
Trust
设置更改回Use System Defaults
然后再次回到Always Trust
。 I have no idea why this works, but it works.我不知道为什么会这样,但它确实有效。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.