xcode 代码签名无效

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/40066576/
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 09:27:59  来源:igfitidea点击:

Code Signature Invalid

xcodeswift3code-signingmacos-sierra

提问by TDM

Recently, I wasn't able to run some of my apps in Xcode. They would build, then quit without showing up. So I tried going into the Debug folder and starting the app manually. I ended up getting an error report from macOS telling me that the exception type was "Code signature invalid". I also ran a test in Xcode and it told me that the code wasn't signed at all, and that it failed with exit code 1. I know that something must be wrong with my code signing in my Xcode projects, but I'm not sure how to fix this. It's affecting both applications that I have on the Mac App Store, so I'm guessing it has to do with certificates. Please let me know how I could fix this. I'm making a macOS app with Xcode 8. I desperately need this error fixed so if you have any ideas please post them and if they work I will promptly award you the +50 rep. Thanks!

最近,我无法在 Xcode 中运行我的一些应用程序。他们会建造,然后不露面就退出。所以我尝试进入 Debug 文件夹并手动启动应用程序。我最终收到了来自 macOS 的错误报告,告诉我异常类型是“代码签名无效”。我还在 Xcode 中运行了一个测试,它告诉我代码根本没有签名,并且它以退出代码 1 失败。我知道我的代码签名在我的 Xcode 项目中一定有问题,但我不知道如何解决这个问题。它影响了我在 Mac App Store 上的两个应用程序,所以我猜它与证书有关。请让我知道如何解决这个问题。我正在使用 Xcode 8 制作 macOS 应用程序。我迫切需要修复此错误,因此如果您有任何想法,请发布它们,如果它们有效,我会立即奖励您 +50 代表。谢谢!

Here is a screenshot of the error I'm getting on one of the projects.

这是我在其中一个项目中遇到的错误的屏幕截图。

Error Screenshot here

错误截图在这里

采纳答案by TDM

Strangely enough, the update to Xcode 8.1 fixed it! So the moral of the story is: try updating if an update is available and see if that fixes any code signing problems!

奇怪的是,Xcode 8.1 的更新修复了它!所以这个故事的寓意是:如果有可用更新,请尝试更新,看看是否可以解决任何代码签名问题!

Thanks everyone for your helpful answers. I'm sure they'll solve someone's problem.

感谢大家的有用答案。我相信他们会解决某人的问题。

回答by karolsenami

You should try cleaning your project (CMD + SHIFT + K), it worked for me.

您应该尝试清理您的项目 ( CMD + SHIFT + K),它对我有用。

回答by drekka

There have been problems in the past with having spaces in names and paths. I would suggest removing the space form the app name and see if that effects anything.

过去存在名称和路径中有空格的问题。我建议删除应用程序名称中的空格,看看是否会产生任何影响。

Also is your test target signed?

您的测试目标是否已签名?

回答by Jos

Experienced the same issue, what helped for me was this:

遇到了同样的问题,对我有帮助的是:

Open finder and show the project package contents, and open the following file with Xcode:

打开finder,显示工程包内容,用Xcode打开如下文件:

project.pbxproj

Search for: PROVISIONING_PROFILE_SPECIFIER

搜索:PROVISIONING_PROFILE_SPECIFIER

And comment it out for both the debug & release section:

并为调试和发布部分注释掉它:

/*PROVISIONING_PROFILE_SPECIFIER = "";*/