Invalid Signature - Code object is not signed at all

人盡茶涼 提交于 2019-11-28 14:05:10

I've checked a variety of places and there seem to be several things that are now being rejected by iTunes Connect. The solution is typically to remove the offending resource from the Target -> Build Phases -> Copy Bundle Resources (as @azizus mentions). Unfortunately Apple doesn't tell you what file causes this issue with your builds so you have to go hunt for yourself. Here are some items that I've found that will do it:

  • Shell scripts (Look for .sh files, though they could have a different extension)
  • Also, look out for files that are listed as executable, when they shouldn't be. Those might be a good place to look for shell scripts that you might have missed.
  • Frameworks (Framework bundles, even .a or .o files - you don't need them as they will get compiled into the executable binary)
  • DocSets (I don't know why, but I found that the HockeyApp SDK includes a DocSet bundle which was the cause in my experience)
  • Sometimes this might also happen due to some weird entitlements issue. The entitlements you have may not match up with the App in the provisioning portal.
  • Look out for invalid characters in your app name or file names (like wildcard characters)

This is a pretty broad list, something I did to help in the search is build an archive and then show the contents of the .app in the archive using finder, sorting by file type. The strange thing is that these files actually exist in the _CodeSignature/CodeResources file.

My own theory on why this is happening is that Apple made some changes (or is making some changes) because of Extensions and WatchKit apps. Essentially, you are including a couple of binaries in the packaged IPA (phone app, extension, watch app). They probably want to make sure you're not including something else that could potentially be executed. Unfortunately, the error message is too vague (really it's incorrect) for most.

This took me 3 days to debug.

In the end it was due to an external framework I created (lets call it X) that I was importing via carthage. X had its own dependencies that it was importing via carthage as well. In order to link these frameworks it had a path in the build settings called Framework Search Paths set to the location of the frameworks. For some reason it was this flag in this framework that was causing the problem specified in the questions. I eventually imported X's dependencies with Git submodules so that I didn't have to set the Framework Search Paths flag. I the exported the framework and manually added it to my project I was submitting to the AppStore. Then it worked.

I contacted HockeyApp and they suggested not to add the SDK to app bundle. So I navigated to Target -> Build Phases -> Copy Bundle Resources and removed HockeySDKResources.bundle from there. iTunes Connect accepted my binary.

In my case it was a info.plist duplicated that was not used. (it wasn't easy find out the problem). I removed almost all the files of my project until remove this one and.. it worked

Clearing the value for Code Sign Resource Rules Path in each target resolved the issue.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!