Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 858
Brittany Avatar asked Jun 07 '15 20:06

Brittany


3 Answers

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
like image 114
Aliaksandr Bialiauski Avatar answered Oct 25 '22 09:10

Aliaksandr Bialiauski


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.

like image 3
Amr Avatar answered Oct 25 '22 09:10

Amr


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.

like image 1
capikaw Avatar answered Oct 25 '22 10:10

capikaw