10

I don't see any reasons why this message should come at the end of the log:

/Users/Val/Library/Developer/Xcode/DerivedData/Mathematics-dzakmzlewrmgvibasvuixiwmkwwp/Build/Products/Debug-iphoneos/Mathematics.app: object file format unrecognized, invalid, or unsuitable
Command /usr/bin/codesign failed with exit code 1    

How can I fix this error?
I am desperate, all my certificates and profiles are valid, the app itself has no bugs at all.

Peter V
  • 2,478
  • 6
  • 36
  • 54
  • 1
    Try to look up these answers, they helped me back then... http://stackoverflow.com/questions/4842717/iphone-codesign-object-file-format-invalid-or-unsuitable – user387184 Sep 07 '11 at 20:10

5 Answers5

6

I ran into the same issue with Xcode 7.0.1 and cocoapods. I ended up doing the following:

  1. Closed Xcode
  2. Removed everything under my DerivedData folder

    rm -fr /Users/{user}/Library/Developer/Xcode/DerivedData/*

  3. Restarted Xcode and rebuilt the project

Ray Hunter
  • 15,137
  • 5
  • 53
  • 51
5

For me, this turned out to be the Build Settings/Build Option/Compiler for C/C++/Objective C had become mismatched between Project and Target ... set to default in each case and problem resolved.

4

Make sure the 'Executable Name' (CFBundleExecutable) entry in your target's info.plist matches the 'Product Name' specified in your target settings.

iPhone Codesign object file format invalid or unsuitable

Community
  • 1
  • 1
HelloWorld
  • 7,156
  • 6
  • 39
  • 36
3

After battling this error for about 2 weeks and trying every suggested solution, in my case the problem was the following:

* Under Project --> Build Settings --> Build Options, the "Build Variants" was set to something different than Targets --> Build Settings --> Build Options --> Build Variants

Make sure these are set to the same setting, which should be "normal".

That change finally got rid of the usr/bin/codesign failed with exit code 1.

2

For me, the solution was:

  1. Navigate to YOURPROJECTNAME.xcodeproj
  2. Right Click and Show the content of package
  3. Enter to xcuserdata and remove all users folders
  4. Right Click on project.xcworkspace and Show the content of package
  5. Enter to xcuserdata and remove all users folders
David Medenjak
  • 33,993
  • 14
  • 106
  • 134
Gerardo
  • 168
  • 2
  • 8