[英]React-native fails to build for ios because command codesign failed with a nonzero exit code
[英]IOS App Build issue: Command CodeSign failed with a nonzero exit code
我正在尝试构建我的 IOS 应用程序(使用电容器和离子框架开发)。 在集成 Google Firebase 并添加 Resources/GoogleService-Info.plist 文件后,我在 XCode 中构建我的应用程序时遇到以下错误。
命令 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
我尝试清理构建缓存,重新启动 xcode。通过电容器重新构建应用程序,但还没有解决这个问题。 任何人都可以帮助解决这个问题吗?
更新
归档应用程序时发生以下错误:
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
我遇到了几乎完全相同的问题,经过几个小时的尝试,这最终对我有用。
问题是由于资源文件夹。 我创建了那个文件夹来添加我的 GoogleServices-Info.plist 文件。
我重命名了我的资源文件夹,并通过在 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" ;
我在存档包含 OneSignal(特别是OneSignalNotificationServiceExtension
)框架的项目时遇到相同的(随机)问题。 我必须做的让它工作 (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
。 我不知道为什么会这样,但它确实有效。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.