"Invalid Signature, code object not signed at all" error

7.1k views Asked by At

I've been browsing Stack for hours in an attempt to try and fix this error, and I've tried everything I can find/think of. I'm submitting an update to an existing app to the App Store, and upon submitting my build, I keep receiving this error:

Invalid signature. Code object is not signed at all. Make sure you have signed your application with a distribution certificate, not an ad hoc certificate or a development certificate. Verify that the code signing settings in Xcode are correct at the target level (which override any values at the project level. Additionally, make sure the bundle you are uploading was built using a Release target in Xcode, not a simulator target.

My app is undoubtedly signed with a distribution certificate, the correct provisioning profile is installed and selected, the profile contains the correct certificate, I've deleted the profile and created a new one in attempt to fix the error, I've reinstalled certificates, restarted Xcode... cleaned the project multiple times, even restarted my system; I'm stumped.

Also: When I do attempt to export the build, even though I've selected to use my provisioning profile and it appears to build with my selected profile, it says it's using "XC [Name of my Profile Here]" provisioning profile. When I check the portal, there's now the profile I created, and a separate profile with the same title with the XC in front of it. Even once I delete this profile on the developer portal, it's recreated? Could this be causing the submission error? Please help.

4

There are 4 answers

1
capikaw On

Now-a-days Xcode has a "Show Log" button.

enter image description here

Tap that and it'll shine some light on the offending framework / script.

enter image description here

In my case, I sometimes forget to remove some debugging Frameworks before making my production build.

0
Amr On

I had the same issue. In my case I am including my own frameworks, which has some script files, I removed those script files from the frameworks targets, and the issue went away.

0
bradkratky On

This issue occurred for me when one of my Cocoapods incorrectly specified the resources in it's podspec so that scripts were inappropriately included.

Updating the suspected podspec to only include resource file types resolved the issue. In this case, I added xcassets to the spec.

s.resources = '<path>/**/*.xcassets'

2
Aliaksandr Bialiauski On

Here is the way I found a script file in the app which caused the error:

  1. Archive the app
  2. Open the archive folder from terminal
  3. Execute the following command grep -r '#!/' *
  4. Review all the files which are returned from the command
  5. Delete all the scripts from Copy Bundle Resources build phase
  6. Profit