iPhone OS 4.0 : Build results in 'incorrect architecture'

My iPhone has been upgraded with version 4.0.

I have tried to build the project from Unity, with OS version 3.2, and at other attempts with OS version 'Unknown'. I also tried with both 'safe and slow' and 'fast' setups.

In accordance with replies to a similar question (an old one though, dated June 24th), I have tried various setups in xCode for the project package and for the project target, to enable armv6 and armv7 architectures, like:

  • switching to "Standard armv6 armv7"
  • switching to iPhone OS 3.2 / iPhone OS 4.0 for the SDK version.

It didn't work for me.

I cannot use the older 3.1.3 version since it is missing, and as far as I can remember what I did last week with 3.2 version was working like a charm.

The best result I could achieve was building and deploying to the iPhone without any warning, but with the iPhone sending the message "Incorrect architecture" to xCode.

Then, when I try any other build, it results in a fatal error that makes Xcode completely unstable.

I am completely stuck! sends an emergency signal to the Unity community

I just hope other Unity iPhone developers out there aren't stuck as I am. Or, that they have been stuck just as I am now, but can send me a quick tip to get out of this mess :)

Note: A possible event would be that the fatal error I receive is due to things that are now 'weak linked'.

The fatal error is:

-[PBXDebugScriptCommand debugSessionDidStart:]: unrecognized selector sent to instance 0x2017df5a0

... and I don't have a clue what it could come from.

Hey, as concluded in the comments:

This thread solves the issue

here's what I do:

Set the project Settings which can be found under: Project > edit project settings To:

  • Base SDK: iPhone Device 4.0

  • Architectures: Standard (armv6 armv7)

Set the active target which can be found under Project > Edit active Target (or doubleclick on the Unity-iPhone in the overview under Targets) To:

  • Base SDK: iPhone Device 4.0

  • Architectures: Standard (armv6 armv7)

Set the active architecture which can be found on the quick select list in the project window right above the overview To:

  • armv6