Xcode 8“应用程序没有有效的签名”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/39187583/
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
Xcode 8 "The application does not have a valid signature"
提问by Alexander Vasenin
回答by Alexander Vasenin
It looks like an Xcode 8 bug. Cleaning the project by pressing Command+Shift+Kor Product -> Cleanfixes it.
它看起来像一个 Xcode 8 错误。通过按Command+Shift+K或Product -> Clean 来清理项目可以修复它。
回答by CJ Dev
I had a similar problem, unfortunately, I'd have to do a full clean frequently, a very expensive (~5-6 minutes) operation for my project and rig.
我遇到了类似的问题,不幸的是,我必须经常进行全面清洁,这对我的项目和装备来说是一项非常昂贵(约 5-6 分钟)的操作。
It turns out this can be caused by (during a custom build phase) adding a custom 'BuildDate' field on my plist AFTER the "Copy Bundle Resources", in order to display that value for debug purposes in the app.
事实证明,这可能是由于(在自定义构建阶段)在“复制捆绑资源”之后在我的 plist 上添加自定义“BuildDate”字段,以便在应用程序中显示该值以进行调试。
Not sure if the error is intentional or an Xcode 8 bug. I also found that performing any editing, even adding and deleting a character to the code base allowed me to run without doing a full clean first.
不确定该错误是故意的还是 Xcode 8 错误。我还发现,执行任何编辑,甚至在代码库中添加和删除一个字符,都可以让我在不先完全清理的情况下运行。
Adding that entry to a separate plist BEFORE the "Copy Bundle Resources" build phase and then drawing from that plist for BuildDate (rather than info.plist) solved the problem for me. More details in the provided source.
在“复制捆绑资源”构建阶段之前将该条目添加到单独的 plist,然后从该 plist 中绘制 BuildDate(而不是 info.plist)为我解决了这个问题。提供的来源中有更多详细信息。
Source: https://forums.developer.apple.com/thread/63955(I do not claim full credit for this fix, but the detailed fix solved the problem for me)
来源:https: //forums.developer.apple.com/thread/63955(我不要求完全归功于此修复,但详细修复为我解决了问题)
回答by Brent Brookler
Another solution is to update the version number. It works and you don't need to clean which saves time.
另一种解决方案是更新版本号。它有效,您无需清洁,从而节省了时间。
回答by Kris
In my case, Xcode shows this error quite randomly. The simplest solution which works for me is to just modify one line of your source code and build the project again. Adding an empty line is enough.
就我而言,Xcode 非常随机地显示此错误。对我有用的最简单的解决方案是只修改一行源代码并再次构建项目。添加一个空行就足够了。
回答by Ganesh
In My Case, It is Provisioning Profile Issue.
就我而言,这是配置文件问题。
Here is the Fix:
这是修复:
1) Select XcodeProject -> Target -> Signing -> Team as None.
2) XCode -> Preferences -> Accounts -> Apple IDs -> (Remove the apple Id once, please make sure you should have apple id credentials in order to add it again)
3) Add the apple ID again.
4) Quit Xcode.
5) Open Xcode
6) Select XcodeProject -> Target -> Signing - > Select the new Team added.
It should be working now.
它现在应该可以工作了。
回答by Will Gwo
This error happened to me when I tried to install .app format application onto iOS physical device. Make sure you are trying to install on the correct deivce type.
当我尝试将 .app 格式的应用程序安装到 iOS 物理设备上时,发生了这个错误。确保您尝试安装在正确的设备类型上。
回答by KoreanXcodeWorker
In my case, one of frameworks was set to Deployment target 12.0, which is higher than my actual device to run.. Fixing it to lower version, worked.
就我而言,其中一个框架设置为部署目标 12.0,这高于我要运行的实际设备。将其修复为较低版本,有效。
回答by dorjeozer
For me the message disappeared after I upgraded iOS from 10.3.3 to 12.3.1 on the device where I was trying to run the application.
对我来说,在我尝试运行应用程序的设备上将 iOS 从 10.3.3 升级到 12.3.1 后,该消息消失了。
回答by Stanislav Dvoychenko
In my case, the problem was in my own framework libraries having "Deployment Target" of 12.1 that was set like this by default on creation by Xcode. The main app I was adding these libraries to was having "Deployment Target" of 9.3. Problem was happening when deploying to iOS 10 physical device. Setting framework libraries to the same "Deployment Target" as the app solved the problem.
就我而言,问题出在我自己的框架库中,其“部署目标”为 12.1,在 Xcode 创建时默认设置为这样。我添加这些库的主要应用程序的“部署目标”为 9.3。部署到 iOS 10 物理设备时出现问题。 将框架库设置为与应用程序相同的“部署目标”解决了问题。
I guess an obvious rule of thumb is to set frameworks to Deployment Targets that are "older", than the target app. My fault, but I'd prefer some warnings and less cryptic error for such a case. Xcode 10.
我想一个明显的经验法则是将框架设置为比目标应用程序“旧”的部署目标。我的错,但我更喜欢这种情况下的一些警告和不太神秘的错误。Xcode 10.
回答by Jeff V
I had the same issue with a watchOS app; the only thing I could get to resolve the issue was to clear out all Provisioning Profiles by deleting them from ~/Library/MobileDevice/Provisioning Profiles/
, and then allowing Xcode to re-download what it needed (I'm allowing Xcode to automatically manage signing).
我在 watchOS 应用程序上遇到了同样的问题;我唯一能解决这个问题的方法是通过从 中删除它们来清除所有配置文件~/Library/MobileDevice/Provisioning Profiles/
,然后允许 Xcode 重新下载它需要的内容(我允许 Xcode 自动管理签名)。