views:

3790

answers:

10

I can't seem to get my app to compile when using JSON-framework http://code.google.com/p/json-framework/ with iPhone SDK 3.0.

My app compiles fine for the simulator, but when I go to compile for my device I get a 'codesign error' code 1. I've followed all of the installation instructions correctly, and when I remove the 'Additional SDK' reference and 'Other Linker Flags: -Obj-C -ljson' it compiles just fine...but obviously I then can't use JSON in my app.

Any ideas?

A: 

Sounds like an issue you would want to discuss with the developers, see the support group.

Nick Veys
+1  A: 

Codesign error means you do not have a valid provisioning profile for the device you are trying to compile to, using the current built settings.

Can you build and deploy sample apps to your phone?

Kendall Helmstetter Gelner
+4  A: 

You may want to just switch to the code version and not link in the static lib.

It should compile and work fine on 3.0.

Genericrich
This works for me too. Thanks.
Michael Grinich
A: 

It seems like the code signing isn't extending to the framework. Have you tried linking the framework differently?

Jason
A: 

I have the same problem, I thought it was the codesigning also but it seems like it does not like something with the SDK. Anyone able to get past this? it did not happen to me until the 3rd beta of the 3.0 SDK

ed Frazier
A: 

I too encountered the same problem. ANyone able to get past this issue?

sg
+1  A: 

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!

that solves the codesign error i was getting, but now I cant compile on 3.0 for some other reason. i'm going to try to link to the code rather than the library.

mike
+3  A: 

On my own project, I too ran into this problem. I was not able to build my app for iPhone OS 2.x using the iPhone 3.0 SDK.

The fix was to set the following at the project level (Get Info):

  • BaseSDK to iPhone Device 3.0
  • iPhone Deployment Target to iPhone OS 2.x
  • Code Signing Resource Rules Path to the same 2.x plist (e.g. /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/ResourceRules.plist)

The last bit allows a distribution (app store) build to code sign correctly... Otherwise you'll encounter an error "object file format invalid or unsuitable" since the code signer by default will use the same resource rules as the BaseSDK (i.e. 3.0), which is unsuitable for a 2.x app.

Also, be sure to clear any of the above settings at the target level (again, via Get Info).

Phew.

z8000
A: 

full tutorial how to use the framework is here: JSON iPhone SDK tutorial

Ondrej
A: 

And for French persons, here is a tutorial too here too (en Français)

But for your problem I think it's not about JSON but more with your key developer.

Vinzius