The version of iPhone OS is too old

Sometimes even when you do everything right it can go wrong. I have seen this problem before but since I saw it again today I thought I would pass it on to anybody who is seeing it for the first time.

As mentioned yesterday Apple has released new firmware and a corresponding update to Xcode and the SDK for iOS 4.0.2. If you upgrade a device before installing the Xcode update you will find you can no longer install development apps to the device. However there is one situation I have found where you can get a similar error message even if you have upgraded Xcode. For reference the error message you will see in the Xcode Organizer window is as follows (this for the 4.0.2 update):

The version of iPhone OS on "iPod Touch" is too old for use with this 
version of the iPhone SDK. Please restore the device to a version of the OS
listed below.

**OS Installed on iPod Touch**
4.0.2 (8A400)

**Xcode Supported iPhone OS Versions**
4.0.2
4.0.1
4.0
3.2.2
3.2.1
3.2
3.1.3
3.1.2
3.1.1
3.1
3.0.1
3.0

This is of course an odd error message (and not just because the Apple marketing department has not yet managed to hunt down all those references to iPhone OS and replace them with iOS). The device has 4.0.2 installed and Xcode supports 4.0.2 but it still complains. The steps to create this problem seem to be as follows:

  • Update Xcode to the latest version (in this case Xcode 3.2.3 with iOS SDK 4.0.2)
  • With Xcode running (after being upgraded) connect the device to iTunes and upgrade the firmware
  • Try to build and install to the new device It seems that Xcode does not fully recognise that the device has been updated. The solution is simple - restart Xcode. In fact restarting Xcode is always a good first try for any such problem. Note that if the error message shows a version on the device that is not present in the list supported by Xcode you probably have not downloaded and installed the latest version of the SDK.