xcode iOS:代码设计错误:子组件 Base.lproj 中的包格式无法识别、无效或不合适

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/28231280/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 06:34:12  来源:igfitidea点击:

iOS: Codesign error: bundle format unrecognized, invalid, or unsuitable in subcomponent Base.lproj

iosxcodecode-signingcodesign

提问by H K

I have a project that was building just fine. Seemingly randomly, doing a Run one time resulted in a codesign error that I've been unable to resolve for 2 days.

我有一个建设得很好的项目。看似随机,执行一次 Run one 会导致我 2 天无法解决的协同设计错误。

The error reads:

错误如下:

bundle format unrecognized, invalid, or unsuitable In subcomponent: /Users/user/Library/Developer/Xcode/DerivedData/.../Base.lproj

捆绑格式无法识别、无效或不合适在子组件中:/Users/user/Library/Developer/Xcode/DerivedData/.../Base.lproj

I'm not sure why this error sprung up. It may have happened after I selected a 'Team' in Xcode - but I can't remember (and I don't know why that would cause an issue). I tried cleaning up my Keychain, creating the bundle identifier in my developer account, a handful of Terminal commands from other posts, to no avail.

我不确定为什么会出现这个错误。它可能发生在我在 Xcode 中选择了一个“团队”之后 - 但我不记得了(我不知道为什么会导致问题)。我尝试清理我的钥匙串,在我的开发人员帐户中创建捆绑标识符,从其他帖子中创建一些终端命令,但无济于事。

What's odd to me is that it seems to indicate it has something to do with Base.lproj - which holds only the LaunchScreen nib and my Main.storyboard. Could there be something in Storyboard that is causing a codesign issue? Something else? SOS.

对我来说奇怪的是,它似乎表明它与 Base.lproj 有关——它只包含 LaunchScreen 笔尖和我的 Main.storyboard。Storyboard 中是否存在导致协同设计问题的内容?还有什么?求救。

回答by Jacob Mouka

This is a big stab in the dark, but I got this error when I added a directory named "resources". Removing it fixed the issue for me.

这是黑暗中的一大刺,但是当我添加一个名为“resources”的目录时出现了这个错误。删除它为我解决了这个问题。

回答by Kunal Arora

I ran into the same issue with Xcode 7.3.1 and cocoapods. I ended up doing the following:

我在 Xcode 7.3.1 和 cocoapods 上遇到了同样的问题。我最终做了以下事情:

1.Closed Xcode

1.关闭Xcode

2.Removed everything under my DerivedData folder

2.删除了我的 DerivedData 文件夹下的所有内容

rm -fr /Users/{user}/Library/Developer/Xcode/DerivedData/*

rm -fr /Users/{user}/Library/Developer/Xcode/DerivedData/*

3.Restarted Xcode and rebuilt the project

3.重启Xcode,重建工程

回答by Vladimír Slavík

I got this error when I added the script fixing a keychain error -34018 which first had appeared in XCode 6.3.

当我添加修复钥匙串错误 -34018 的脚本时出现此错误,该错误首次出现在 XCode 6.3 中。

#!/bin/sh
codesign --verify --force --sign "$CODE_SIGN_IDENTITY" 
"$CODESIGNING_FOLDER_PATH"

回答by prabodhprakash

If you are using CocoaPods, then update CocoaPods and then all the pods worked from me.

如果您使用的是 CocoaPods,请更新 CocoaPods,然后所有的 Pod 都在我这里工作。

sudo gem update cocoapodsfollowed by pod install

sudo gem update cocoapods其次是 pod install