xcode 应用安装失败。未找到代码签名
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/52373664/
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
App Installation failed. No code signature found
提问by Josh
I recently upgraded to Xcode 10 and began the process of updating our app to switch 4.2 After a day or so of rebuilding 3rd party frameworks and adding in workarounds to various issues, I was able to run our app on the new simulators.
我最近升级到 Xcode 10 并开始更新我们的应用程序以切换 4.2 经过一天左右的重建 3rd 方框架并添加各种问题的解决方法后,我能够在新的模拟器上运行我们的应用程序。
However, when I tried running on my personal phone (running iOS 12.0 GM) I ran into an error when installing the app as described in the title.
但是,当我尝试在我的个人手机上运行(运行 iOS 12.0 GM)时,我在安装标题中描述的应用程序时遇到了错误。
I know that there are a lotof alreadyansweredquestionsregarding this topic on SO & the Internet, however I was unable to get any of these to work.
我知道,有一个很大的已经回答了问题,关于对SO +互联网这个话题,但我无法得到任何的这些工作。
It's been blocking me for around a day & a half now so I was wondering if anyone had any insight into how this could be mitigated.
它已经阻止了我大约一天半,所以我想知道是否有人对如何减轻这种情况有任何见解。
Here are the steps I've take so far that have not worked (perhaps they will work for others in the future!):
以下是我迄今为止采取的但没有奏效的步骤(也许它们将来会对其他人有用!):
- Clearing derived data
- Deleting and re-downloading all provisioning profiles on my computer
- Cleaning the build directory (cmd + k & cmd + shft + k)
- Deleting the original app from my phone
- Restarting Xcode (Version 10.0 (10A254a) [the GM])
- Restarting my Mac (Macbook Pro 2018 running macOS High Sierra)
- Restarting my device (iPhone X running iOS 12.0 GM)
- Many various combinations of the above, including all at once
- Re-generating provisioning profiles for the app on developer.apple.com (we use manual signing)
- Deleting and recreating provisioning profiles for the app on developer.apple.com
- Sacrificed a goat to Tim Cook
- Ensuring the signing certificate matches the provisioning profile
- Deleting the old version of Xcode from my computer & insuring command line tools are on the xcode 10.0 gm version
- Deleting & reinstalling Xcode 10.0 GM
- Ensuring all copied frameworks have
code sign on copy
checked - Rebuilding all frameworks via Carthage using the swift 4.2 compiler (remember, it all works on the simulator).
- Ensured code signing required is set to YES in the SDKSettings.plist
- deleted all old signing certificates on my computer
- Deleted & recreated certificates on developer.apple.com
- Removed & re-added my device to developer.apple.com
- Changed code signing from manual to automatic
- Ensured that signing certificates are
Developer
and notDistribution
- 清除派生数据
- 删除并重新下载我计算机上的所有配置文件
- 清理构建目录(cmd + k & cmd + shft + k)
- 从我的手机中删除原来的应用程序
- 重新启动 Xcode(版本 10.0 (10A254a) [GM])
- 重新启动我的 Mac(运行 macOS High Sierra 的 Macbook Pro 2018)
- 重新启动我的设备(运行 iOS 12.0 GM 的 iPhone X)
- 以上的多种组合,包括一次全部
- 在 developer.apple.com 上为应用程序重新生成配置文件(我们使用手动签名)
- 在 developer.apple.com 上删除和重新创建应用程序的配置文件
- 为蒂姆库克献了一只山羊
- 确保签名证书与配置文件匹配
- 从我的电脑中删除旧版本的 Xcode 并确保命令行工具在 xcode 10.0 gm 版本上
- 删除并重新安装 Xcode 10.0 GM
- 确保所有复制的框架都已
code sign on copy
检查 - 使用 swift 4.2 编译器通过 Carthage 重建所有框架(请记住,这一切都在模拟器上运行)。
- 在 SDKSettings.plist 中确保代码签名需要设置为 YES
- 删除了我计算机上的所有旧签名证书
- 在 developer.apple.com 上删除并重新创建证书
- 删除并将我的设备重新添加到 developer.apple.com
- 将代码签名从手动更改为自动
- 确保签名证书是
Developer
和不是Distribution
Any help would be greatly appreciated :)
任何帮助将不胜感激 :)
Update: I tried redownloading and rebuilding from the ground up on a fresh machine, and the same issue occurs. Interestingly I can archive and validate the app just fine.
更新:我尝试在新机器上重新下载和重建,但出现了同样的问题。有趣的是,我可以很好地存档和验证应用程序。
Also tried signing an empty project with the same bundle ID and it worked fine. So the issue is either in our 3rd party frameworks or some weird setting that got enabled while transitioning from Xcode 9.4. Going to start removing 3rd party frameworks one by one until I can get this to compile.
还尝试使用相同的包 ID 签署一个空项目,它工作正常。所以问题要么出在我们的 3rd 方框架中,要么出在从 Xcode 9.4 转换时启用的一些奇怪的设置。将开始一个一个地删除第 3 方框架,直到我可以编译它为止。
Update 2: Still no luck. Tried clearing out most frameworks and nothing. Here are the device logs, wondering if Skipping a profile because of error 0xe8008012
has something to do with it:
更新 2:仍然没有运气。尝试清除大多数框架,但一无所获。这是设备日志,想知道是否Skipping a profile because of error 0xe8008012
与它有关:
https://gist.github.com/joshuawright11/6889ce1a0872262df77f97d63830baa5
https://gist.github.com/joshuawright11/6889ce1a0872262df77f97d63830baa5
Update 3: So I was able to get it to install, by commenting out the carthage copy-frameworks script in the build phases (and cleaning/nuking derived data after doing so). Of course this means that it crashes on boot since it's missing those frameworks, but it does mean the issue is either with carthage or one of the linked carthage frameworks. Not our signing certs, provisioning profiles, or codebase. Going to try removing those frameworks one by one and I'll update here.
更新 3:所以我能够通过在构建阶段注释掉 carthage copy-frameworks 脚本(并在这样做之后清理/删除派生数据)来安装它。当然,这意味着它在启动时崩溃,因为它缺少这些框架,但这确实意味着问题出在迦太基或链接的迦太基框架之一。不是我们的签名证书、配置文件或代码库。打算一一删除这些框架,我会在这里更新。
Final UpdateFigured it out finally. The solution turned out to be pretty niche (see below) but hopefully this question serves as a compilation of every solution related to this issue across the internet haha.
最后更新终于搞清楚了。结果证明该解决方案非常小众(见下文),但希望这个问题可以作为互联网上与此问题相关的每个解决方案的汇编,哈哈。
采纳答案by Josh
Figured it out:
弄清楚了:
I ran into this issue with carthage: https://github.com/Carthage/Carthage/issues/2472and used their suggested solution of setting EXPANDED_CODE_SIGN_IDENTITY='' when I was transferring stuff over to xcode 10.
我在使用 carthage 时遇到了这个问题:https: //github.com/Carthage/Carthage/issues/2472并在我将内容转移到 xcode 10 时使用了他们建议的设置 EXPANDED_CODE_SIGN_IDENTITY='' 的解决方案。
Evidently this line is what causing carthage to hurt itself when copying frameworks, causing the error. I downloaded the most recent version of carthage to fix the issue, and then removed the EXPANDED_CODE_SIGN_IDENTITY=''
line and everything worked. What a waste of time.
显然这一行是导致迦太基在复制框架时伤害自己,导致错误的原因。我下载了最新版本的 carthage 来解决这个问题,然后删除了该EXPANDED_CODE_SIGN_IDENTITY=''
行,一切正常。真是浪费时间。
回答by mihai1990
Not sure if this is also your case, but I also encountered this error recently while trying to run a React Native app on iPhone. It started happening after I integrated Lottie library for React Native
不确定这是否也是您的情况,但我最近在尝试在 iPhone 上运行 React Native 应用程序时也遇到了这个错误。它在我为 React Native集成Lottie 库之后开始发生
The issue was caused by this Run Script added in Build Phases: http://ikennd.ac/blog/2015/02/stripping-unwanted-architectures-from-dynamic-libraries-in-xcode/. The script failed to extract architectures from Lottie.framework giving a "input file (.../Lottie.framework/Lottie) must be a fat file when the -extract option is specified
该问题是由在构建阶段添加的运行脚本引起的:http: //ikennd.ac/blog/2015/02/stripping-unwanted-architectures-from-dynamic-libraries-in-xcode/。该脚本未能从 Lottie.framework 中提取架构,给出了一个"input file (.../Lottie.framework/Lottie) must be a fat file when the -extract option is specified
To fix this I added a verification in the script to skip non-fat files:
为了解决这个问题,我在脚本中添加了一个验证来跳过非胖文件:
# ...
echo "Executable is $FRAMEWORK_EXECUTABLE_PATH"
if lipo -info "$FRAMEWORK_EXECUTABLE_PATH" | grep -iq "Non-fat file"
then
echo "This is a non-fat file, skipping"
continue
fi
EXTRACTED_ARCHS=()
# ...
回答by mihai1990
I have had the same problem with xcode 10.0 (10A255).
我在 xcode 10.0 (10A255) 上遇到了同样的问题。
Invalid Signature - A sealed resource is missing or invalid. The file at path [xxxx.app/xxxxx] is not properly signed.
无效签名 - 密封资源丢失或无效。路径 [xxxx.app/xxxxx] 处的文件未正确签名。
xcode 9.4.1 (9F2000) was always able to submit the app without problems.
xcode 9.4.1 (9F2000) 总是能够毫无问题地提交应用程序。
I could fix the problem deleting all of the supporting files (txt,json,rtf,html,ttf, etc.) and then, adding them again.
我可以解决删除所有支持文件(txt、json、rtf、html、ttf 等)的问题,然后再次添加它们。
I suggest you to submit a build without the files. If this works you can add them again step by step
我建议你提交一个没有文件的构建。如果这有效,您可以一步一步地再次添加它们
回答by Alfi
回答by Branislav Bily
I've tried everything in this thread but nothing worked. So I just reinstalled Xcode and suddenly everything works again.
我已经尝试了这个线程中的所有内容,但没有任何效果。所以我刚刚重新安装了 Xcode,突然一切又恢复了。
回答by wcribbs
In my case I had both an invalid iPhoneXS provision and bundle identifier conflict. My project was attempted after an Xcode upgrade and said new phone attached. After doing the above steps (completely recreated key chain and profiles, deleted persistent folder etc...).
就我而言,我有一个无效的 iPhoneXS 条款和捆绑标识符冲突。我的项目是在 Xcode 升级后尝试的,并说连接了新手机。完成上述步骤后(完全重新创建钥匙链和配置文件,删除持久文件夹等...)。
On Target Project Settings:
在目标项目设置上:
- Set bundle identifier from com.proj.app to anything else, ex: com.proj.app2
- Change Product name from Product to Product123
- 将包标识符从 com.proj.app 设置为其他任何内容,例如:com.proj.app2
- 将产品名称从 Product 更改为 Product123
I'm pretty sure only the bundle identifier conflict blocked the normal auto entry of my device into the provisioned devices.
我很确定只有捆绑标识符冲突阻止了我的设备正常自动进入配置的设备。
- Change back identifiers to normal (if desired)
- 将标识符改回正常(如果需要)
回答by user23
In the build phases/Carthage of the project target put the carthage command like this:
在项目目标的构建阶段/Carthage 中,像这样放置 carthage 命令:
EXPANDED_CODE_SIGN_IDENTITY='' carthage copy-frameworks
EXPANDED_CODE_SIGN_IDENTITY=''迦太基复制框架
This is only a temporal solution while the get environments var issue is solved.
这只是一个临时解决方案,而获取环境变量问题已解决。