本文介绍了代码标记在Cordova构建ios期间找不到Team ID时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 阅读所有先前关于代码标记错误的帖子后,我达到了一个死胡同。在使用ios平台(版本3.8.0)构建cordova项目(版本4.3.0)并使用Bamboo服务器进行持续集成时。我无法让我的应用程式签署发布的iOS应用程式。这是我的构建任务的顺序: 解锁钥匙串(我确保我的iPhone开发人员和分发证书是有效的,我也确认没有在Bamboo服务器上弹出的权限窗口,例如,请求解锁密钥链的权限。) cordova平台删除ios(清理目录 cordova build ios 添加ios的插件 release --device(用于设备最终上传到应用商店的版本) xcrun嵌入mobileprovision 然后在运行上面的#5任务时出现这个错误: === BUILD TARGET Abczyx OF项目Abczyx与配置版本=== 检查依赖项代码签名错误:未找到代码签名身份:没有匹配团队ID(null)的有效签名身份(即证书和私钥对)发现。 CodeSign错误:SDK'iOS 8.1'中的产品类型应用程序需要代码签名 以下构建命令失败:检查依赖关系 )命令的错误代码65:xcodebuild with args:-xcconfig,/ usr / local / Bamboo / Abczyx / platforms / ios / cordova / build-debug.xcconfig,-project,Abczyx.xcodeproj,ARCHS = armv7 armv7s arm64,-target,Abczyx,-configuration,Release,-sdk,iphoneos,build,VALID_ARCHS = armv7 armv7s arm64,CONFIGURATION_BUILD_DIR = / usr / local / Bamboo / Abczyx / platforms / ios / build / device,SHARED_PRECOMPS_DIR = / usr / local / Bamboo / Abczyx / platforms / ios / build / sharedpch 构建平台之一的错误:错误:/ usr / local / Bamboo / Abczyx / platforms / ios / cordova / build:代码2 这里是我的 build-release.xcconfig : #includebuild.xcconfig CODE_SIGN_IDENTITY = iPhone分发 CODE_SIGN_IDENTITY [sdk = iphoneos *] = iPhone发行版 #includebuild-extras.xcconfig b $ b 这是我的 build.xcconfig : //用于代码签名的签名身份类型,解析为给定类型的第一个匹配。 //iPhone Developer:开发构建(默认,仅限本地; iOS开发证书)或iPhone分发:分发构建(Adhoc / In-House / AppStore; iOS分发证书) CODE_SIGN_IDENTITY = iPhone开发人员 CODE_SIGN_IDENTITY [sdk = iphoneos *] = iPhone开发人员 //(CB-7872)与资源信封格式弃用相关的XCode 6.1签名错误解决方案 CODE_SIGN_RESOURCE_RULES_PATH = $ (SDKROOT)/ResourceRules.plist Bamboo服务器正在运行Xcode 6.1.1 Build版本6A2008a OS X 10.9.4。我点击刷新xcode的首选项>帐户>用户>签名身份和配置配置文件屏幕。 我使用Xcode 6.2,Build版本6C131e在OS X 10.9 .4 mac book pro我的本地机器,我仍然得到这个相同的错误。但是,奇怪的事情之一是,在我的本地机器上,我有时运行 cordova build ios --device ,而没有 - release 标志,我能够在我的平台/ ios / build /设备文件夹中构建一个签名的调试,但这不工作在远程Bamboo服务器上(虽然它工作一次许多天前)。 我在这里研究了Cordova iOS v.3.8.0的发行版,发现没有什么有用的尝试超越CB-7872 CODE_SIGN_RESOURCE_RULES_PATH = $(SDKROOT)/ResourceRules.plist ,已修正: https://github.com/apache/cordova-ios/blob/master/RELEASENOTES.md 我已验证Bamboo服务器包含它检查的sdk iphoneos8.1。 我已经验证配置文件条款是最新的,没有人在我的repo上工作。 / p> 我已经验证我的CODE_SIGN_IDENTITY是这个帖子和脚本的好: Xcode失败,并显示代码签名错误 我已经尝试在构建后添加延迟,但我已经失败的构建步骤,我可以尝试这之前:无法生成cordova ios应用的发布版本 我试图去除自动完成/管理方案功能,但不确定这只是另一个兔子洞落在xcodebuild说不包含方案 我试过在这里查看源代码: https ://github.com/apache/cordova-ios/blob/master/bin/templates/scripts/cordova/lib/build.js 但我没有看到任何明显的确认或测试... 两个问题: teamID?如何检查其检查的位置? 我还缺少什么?我还能检查什么? 解决方案 TL; DR 为什么teamID有一个null如何检查检查的位置? iPhone发行版可能是不正确的钥匙串设置。 我还缺少哪些内容?我还能检查什么?特别是在的cordova build ios脚本源码中? 如果使用命令行工具,请确保设置正确的标志和选项。否则,尝试不同的包装工具,如Fastlane ruby gem。 长版本 我们使用一个包装工具,围绕苹果开发者控制台和代码签名,并确保p12文件(cert + key)文件设置正确。 安装KrauseFx的Fastlane宝石: https://github.com/KrauseFx/fastlane 将iPhone分发版p12文件从Keychain Access从我们的Bamboo构建服务器导出到本地计算机(以便于故障排除)。 p12文件基本上包括一个带有嵌套键图标的证书,这在上面的注释中是必需的。 双击p12文件,将其安装在login 钥匙扣。 打开Xcode>首选项,确保iOS分发是作为签名身份的一部分添加的(显示了iOS开发和iOS分发) 清新您的cordova /项目目录(无平台或插件或使用 cordova platform rm ios 等)。 我们跑了 cordova build ios --device --release ,它构建了我们的 Abczy.app。 移动到正确的cordova平台目录,因为相对路径可能无法正常工作:〜/.../ platforms / ios / build / device(检查 .app 文件) 运行此命令将 .app .ipa : xcrun -sdk iphoneos PackageApplication -v Abczyx.app -o / Users / myname / Desktop (我已将所产生的 .ipa 移动到我的桌面上,以方便操作)。 转到包含您的 .ipa 的文件夹,并确保您有来自apple开发人员的mobileprovision文件包含在同一目录中。 运行: 叹息辞职./Abczyx.ipa -pAbczyx-dist.mobileprovision。复制并粘贴您将使用的证书/密钥的名称,然后它将使用分发mobileprovision签署应用程序。 或者,您可以输入:叹息辞职./Abczyx。如果您使用开发人员mobileprovision,将会收到致命错误, ipa -iiPhone开发人员:Joey Jojobuttafucco(123FTR12PAC)-pAbczyx-dist.mobileprovision After reading through all of the previous posts on code sign errors, I have reached a cul-de-sac. While building a cordova project (version 4.3.0) with ios platform (version 3.8.0) and using a Bamboo server to do the continuous integration. I cannot get my app to sign the iOS app for the release. This is the order of my build tasks:unlock keychain (I've made sure that my iPhone Developer and Distribution certificates were valid and not expired. I've also made sure that there are no permission windows that pop up on the Bamboo server, e.g. asking permission to unlock keychain.)cordova platform remove ios (to clean the directory and start fresh)add plugins for ioscordova platform add ioscordova build ios --release --device (build release version for a device to eventually upload to app store)xcrun to embed the mobileprovisionI then get this error when running #5 task above: === BUILD TARGET Abczyx OF PROJECT Abczyx WITH CONFIGURATION Release === Check dependencies Code Sign error: No code signing identities found: No valid signing identities (i.e. certificate and private key pair) matching the team ID "(null)" were found. CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 8.1' The following build commands failed: Check dependencies (1 failure) Error code 65 for command: xcodebuild with args: -xcconfig,/usr/local/Bamboo/Abczyx/platforms/ios/cordova/build-debug.xcconfig,-project,Abczyx.xcodeproj,ARCHS=armv7 armv7s arm64,-target,Abczyx,-configuration,Release,-sdk,iphoneos,build,VALID_ARCHS=armv7 armv7s arm64,CONFIGURATION_BUILD_DIR=/usr/local/Bamboo/Abczyx/platforms/ios/build/device,SHARED_PRECOMPS_DIR=/usr/local/Bamboo/Abczyx/platforms/ios/build/sharedpchERROR building one of the platforms: Error: /usr/local/Bamboo/Abczyx/platforms/ios/cordova/build: Command failed with exit code 2Here is my build-release.xcconfig: #include "build.xcconfig" CODE_SIGN_IDENTITY = iPhone Distribution CODE_SIGN_IDENTITY[sdk=iphoneos*] = iPhone Distribution #include "build-extras.xcconfig"Here is my build.xcconfig: // Type of signing identity used for codesigning, resolves to first match of given type. // "iPhone Developer": Development builds (default, local only; iOS Development certificate) or "iPhone Distribution": Distribution builds (Adhoc/In-House/AppStore; iOS Distribution certificate) CODE_SIGN_IDENTITY = iPhone Developer CODE_SIGN_IDENTITY[sdk=iphoneos*] = iPhone Developer // (CB-7872) Solution for XCode 6.1 signing errors related to resource envelope format deprecation CODE_SIGN_RESOURCE_RULES_PATH = $(SDKROOT)/ResourceRules.plistThe Bamboo server is running Xcode 6.1.1 Build version 6A2008a on a OS X 10.9.4. And I clicked refresh for the xcode's preferences > Accounts > user > Signing identities and provisioning profiles screen.I'm using Xcode 6.2, Build version 6C131e on a OS X 10.9.4 mac book pro for my local machine and I still get this same error. However, one of the strange things is that on my local machine, I sometimes run cordova build ios --device without the --release flag and I'm able to build an .ipa in my platforms/ios/build/device folder that is signed for debug, but this doesn't work on the remote Bamboo server (although it worked once many days ago).I've studied the releasenotes for Cordova iOS v.3.8.0 here and found nothing helpful to try beyond CB-7872 CODE_SIGN_RESOURCE_RULES_PATH = $(SDKROOT)/ResourceRules.plist, which has already been fixed: https://github.com/apache/cordova-ios/blob/master/RELEASENOTES.mdI've verified that the Bamboo server contains the sdk iphoneos8.1 that it's checking.I've verified that profile provisions are up to date and no one else has worked on my repo.I've verified that my CODE_SIGN_IDENTITY is good with this post and script: Xcode fails with "Code Signing" ErrorI've tried adding a delay after building but I'm failing the build step already before I can try this: Failed to generate release build of cordova ios appI've tried to look at removing the auto-complete/manage schemes feature but not sure this is just another rabbit hole to fall in: xcodebuild says does not contain schemeI've tried looking at the source here: https://github.com/apache/cordova-ios/blob/master/bin/templates/scripts/cordova/lib/build.js But I don't see anything obvious to confirm or test...Two questions:Why is there a "null" for teamID? How can I check where it's checking?What else am I missing? What else can I check? Specifically in the source of cordova build ios script? 解决方案 TL;DRWhy is there a "null" for teamID? How can I check where it'schecking?Most likely improper keychain setup for iPhone distribution. Check and make sure you have the cert with the nested key.What else am I missing? What else can I check? Specifically in thesource of cordova build ios script?Ensure proper flags and options are set if you using command line tools. Otherwise, try different wrapper tools like Fastlane ruby gem.Long versionWe figured it out using a wrapper tool around Apple developer console and code signing and making sure the p12 file (cert+key) file was set correctly.Install KrauseFx's Fastlane gem: https://github.com/KrauseFx/fastlaneExport the iPhone distribution p12 file from Keychain Access from our Bamboo build server to a local computer (for easier troubleshooting). The p12 file basically includes a cert with a nested key icon, which is necessary as Rich Tolley mentioned above in the comments.Double-click on the p12 file to install it in the "login" keychain. Make sure you can see the nested cert-key structure.Open Xcode>Preferences and ensure that iOS Distribution is added as part of the Signing Identities (both iOS Development and iOS Distribution is shown)Clean your cordova/project directory by starting fresh (no platforms or plugins or using cordova platform rm ios etc.). Then add the plugins, then add the platforms.We ran cordova build ios --device --release, which build our "Abczy.app".Move into the correct cordova platforms directory since relative path may not work correctly: ~/.../platforms/ios/build/device (check that the .app file is there)Run this command to convert the .app into an .ipa:xcrun -sdk iphoneos PackageApplication -v Abczyx.app -o /Users/myname/Desktop(I've moved the resulting .ipa onto my desktop to make it easier to manipulate).Go to the folder containing your .ipa and ensure you have the mobileprovision file from apple developer included in the same directory.Run: sigh resign ./Abczyx.ipa -p "Abczyx-dist.mobileprovision". Copy and paste the name of the cert/key you will use and then it will sign the app with the distribution mobileprovision. If you use a developer mobileprovision, it will get a fatal error but the app will be signed anyway.Alternatively, you can type: sigh resign ./Abczyx.ipa -i "iPhone Developer: Joey Jojobuttafucco (123FTR12PAC)" -p "Abczyx-dist.mobileprovision" 这篇关于代码标记在Cordova构建ios期间找不到Team ID时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-20 15:14