'How do you fix "code object is not signed at all In subcomponent:" in Xcode 6, Mac OS X Yosemite or Mavericks?

When compiling my application I'm getting the following error:

CodeSign /Users/pupeno/Library/Developer/Xcode/DerivedData/ProjectX-cynmgyozflnwbpamwnpsnhgshuyq/Build/Products/Debug/Project\ X.app
    cd /Users/pupeno/Projects/ProjectX
    export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate

Signing Identity:     "Mac Developer: José Fernández (G4PM7K38JH)"

    /usr/bin/codesign --force --sign A21FB31766DDCBB28FBB4E4DD86E3743024A45F3 --entitlements /Users/pupeno/Library/Developer/Xcode/DerivedData/ProjectX-cynmgyozflnwbpamwnpsnhgshuyq/Build/Intermediates/ProjectX.build/Debug/App.build/Project\ X.app.xcent --requirements =designated\ =>\ anchor\ apple\ generic\ \ and\ identifier\ \"$self.identifier\"\ and\ ((cert\ leaf[field.1.2.840.113635.100.6.1.9]\ exists)\ or\ (\ certificate\ 1[field.1.2.840.113635.100.6.2.6]\ exists\ and\ certificate\ leaf[field.1.2.840.113635.100.6.1.13]\ exists\ \ and\ certificate\ leaf[subject.OU]\ =\ \"XHT4M2DATL\"\ )) /Users/pupeno/Library/Developer/Xcode/DerivedData/ProjectX-cynmgyozflnwbpamwnpsnhgshuyq/Build/Products/Debug/Project\ X.app

/Users/pupeno/Library/Developer/Xcode/DerivedData/ProjectX-cynmgyozflnwbpamwnpsnhgshuyq/Build/Products/Debug/Project X.app: code object is not signed at all
In subcomponent: /Users/pupeno/Library/Developer/Xcode/DerivedData/ProjectX-cynmgyozflnwbpamwnpsnhgshuyq/Build/Products/Debug/Project X.app/Contents/Frameworks/Paddle.framework
Command /usr/bin/codesign failed with exit code 1

I'm using two frameworks, Paddle and Sparkle and they are configured to sign on copy:

enter image description here

Looking for a solution to this problem I found many recommendations to do a --deep sign, which is officially discouraged by Apple (Using the codesign Tool's --deep Option Correctly).

I also found the article Code Signing and Mavericks which also explains that using --deep is wrong and offers an alternative: using a script to generate signatures for each framework. I think this is something that was needed before Xcode had the option to sign on copy, but I gave it a try anyway. It made no difference, I still get the same error. Looking at the logs, the bundles are getting signed with the "Sign on copy" option, so, adding that script caused them to get signed twice.

My code signing identity is configured as follows for the whole project and each target just inherits it:

enter image description here

I understand that's not the appropriate signature for Release, but for now, we are just trying to get this to build and run locally.

Any ideas what's wrong? Any ideas how to fix it? I understand that



Solution 1:[1]

For me I had to go to the Project build settings and set Other Code Signing Flags to --deep. The problem was that my framework in the project was not signed.

Solution 2:[2]

For All who still are facing this issue, Please make sure 'Product Name' in build setting matches with 'Executable file' set in info.plist.

Generally when we duplicate exiting code, we simply change either product name or Executable file, and this mismatched creates a issue. enter image description here

enter image description here

Solution 3:[3]

For me the solution was to re-Add a resource folder (checking Create groups instead of create folder references).

Solution 4:[4]

Adding ANOTHER thing to check if you get this error:

In the Build Phases pane for your Project's application target, make sure the Embed Frameworks phase comes before the Link Binary With Libraries phase:

enter image description here

I'm running macOS 11.2.3 and Xcode 12.4.

An Aside:

It's utterly ridiculous how fragile and broken code-signing remains. It's 2021 and this post alone has 87 different "fixes" to solve the same damn error message. There's just no excuse for wasting developers' time like this. Fix your IDE, Apple.

Solution 5:[5]

I'll admit codesigning is still a black art to me, but in Xcode 6 I found that removing all of my signing scripts (which were necessary in Xcode 5, along with --deep flags) and additional signing flags, and just using the "codesign on copy" option in the Framework's Copy Files phase of the build worked flawlessly for me.

Solution 6:[6]

For me this problem was resolved by a simple "clean build folder" action, keyboard shortcut: shift+option+command+K.

Solution 7:[7]

For me, it turned out that I had inadvertently added a bash build script to the target. Making sure I had no sneaky scripts accidentally copied into the target fixed the issue.

Solution 8:[8]

for me, one of the frameworks I was including, had another of the frameworks marked as "embed and sign"... which you can't do... only the app should be doing that. marking the grandchild framework as "do not embed" in the child framework, removed this issue.

Solution 9:[9]

I faced this problem after adding fastlane to upload screenshots to App Store Connect automatically. I had to remove fastlane from the project and clean the build folder to make it work again.

Solution 10:[10]

Using CocoaPods in the project it helped me to go to the Pods project, select a problem framework and set the correct developemtn team on Signing & Capabilities page or Build settings with All levels set.

Solution 11:[11]

In my case I both had a subproject and a subproject of that subproject (i.e. a sub-subproject) to which I had added the same Swift package dependency. Keeping it in the sub-subproject and removing it from the subproject solved the issue.

Solution 12:[12]

  1. Product -> Cleanup build folder
  2. Build/Compile project

Solution 13:[13]

As shown by the number of answers here the causes for the error can be many. In my experience building a complex project with multiple level of Frameworks, Static libraries from Swift packages and Pods you should follow these rules:

  • A Framework can't embed and sign another framework: only and App can do that.
  • A Framework can use a static library (from a Swift Package for instance) but the library must be present only in the Framework and not in the main App. If the same library is embedded in both Framework and main App, in some unknown circumstances, this error occurs.
  • Be sure to clean the build folder after each change to frameworks and library structure/embed