I started using the lovely json-framework for the iPhone but then suddenly found that if I compiled for anything greater than 2.1 for a device, that it would pop up with:

Codesign error: “object file format invalid or unsuitable”

It took me a long time to figure out what was going on, but thanks to a blog post, the fix is this:

On the project settings, on the build tab, search for “Code Signing Resource Rules Path” and set “$(SDKROOT)/ResourceRules.plist” as its value.

I’m not sure how it works as it looks like that is the path it already has, but hey, it seems to work!

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Twitter

23 Responses to “JSON Framework Codesign – “object file format invalid or unsuitable””

  1. Wess says:

    Thank you, I appreciate you posting this regardless of how simple it is. I don’t understand it either, but you saved me, so thank you

  2. Carles says:

    Wow man! I cannot believe what a luck I had finding this post in just one googling… Otherwise it could had taken me ages to figure this out… Thx!!!!

  3. [...] – “object file format invalid or unsuitable” « Matt Galloway’s iPhone Apps JSON Framework Codesign – “object file format invalid or unsuitable” « Matt Galloway’s … [...]

  4. Moritz says:

    Thank you, Thank you, Thank you!
    Thank you for posting this simple, yet very helpful solution.
    Moritz

  5. [...] to some google searching and a blog post by matt galloway, i figured it out.  here’s what to [...]

  6. mike says:

    thank you so much for this. so lucky i stumbled upon this link

  7. Ris Shin says:

    Hei man, you save me

  8. hristo says:

    Thanks a lot man, very helpful

  9. Thanks! This fixed my issue as well.

  10. Devang says:

    thanks so much…u saved me too!!

  11. [...] So, to get it installed, follow the Option 2 in the json-framework install instructions, then reset the compiler to gcc 4.2 this is a key point, somehow adding the framework breaks this and you start getting all sorts of strange errors. Then finally you need to add the SDKs code signing resource rules ($(SDKROOT)/ResourceRules.plist) to the code signing resource rules pat… [...]

  12. Don says:

    Awesome, same problem, same solution. Thanks!!!

  13. DailyGD says:

    IT WORKED!!! Thanks. I only lost half of my day!

  14. Perfect!

    I could build and deploy old and new apps except for one pesky app. This fixed it.

  15. Max says:

    I totally agree what it do I would like to know but i sure worked, magic, thanks a lot

  16. mark says:

    I found that this worked, but only for the first build after it was changed. Subsequent builds failed unless the change was re-done!

  17. jathin says:

    Thanks a ton dude….awesome solution

  18. Adam says:

    The linked blog post has vanished.

    And this fix doesn’t seem to work any more :( .

  19. admin says:

    Hmmm that’s strange that it doesn’t work anymore for you. What version of the SDK are you compiling for?

    I might switch over to TouchJSON at some point anyway to be honest – have you tried that?

  20. Patrick says:

    Holy crap! Thank you! Same problem, banging my head against the private key / provisioning / certificate wall for hours. We had this setting correct in our debug config but forgot to set it for our distribution config.

    You saved my Thanksgiving, and many other things. Thanks again!

  21. Adrian says:

    The fix worked for me, thanks a lot! I got this problem after changing the product name of my app.

  22. oscar says:

    you just saved me about 1 week.

Leave a Reply