« Back to blog

How To Fix Xcode 4 and PhoneGap Building Issues

(download)

Today i was playing around with the latest release of Apples Xcode 4. I just wanted to use PhoneGap with Xcode 4, but it i doesn't compile my PhoneGap App.

After searching around the internet i found out, that is quit easy to get Xcode and PhoneGap working. 

You just need to edit your "Valid Architectures" Settings. Just follow the steps below. 
  • Click at your Project Name in the Xcode sidebar (first item in your Filelist, should be named after your Project).
  • You will get a second sidebar with a separated list (Project and Targets).
  • Click on the Project Name and on "Build Settings" to the right.
  • Doubleclick "Valid Architectures" and add a new Architecture called "i386". Cick "done" to save it.
  • Now, do exactly the same with your Target (the second entry in the second sidebar).
  • After doing this to your Project and Target you need to add "i386" also to "PhoneGapLib.xcodeproj".
  • To do that, just expand your Filelist and select "PhoneGapLib.xcodeproj".
  • There, you only add "i386" to the Project item and not the Target.
After all these steps, you should get Xcode4 and PhoneGap Projects to compile successfully.

Mar 22, 2011
Mike said...
thanks - after an hour of fighting this and trying other options - this worked!
Mar 26, 2011
Enrique said...
Thanks!! this was the fine tuning I needed. Finally I got my app working with Xcode 4.
Regards!