Search Unity

Unity 3.2 working with Xcode 4?

Discussion in 'iOS and tvOS' started by jmpp, Feb 12, 2011.

  1. jmpp

    jmpp

    Joined:
    Jun 1, 2010
    Posts:
    93
    Has anyone been able to compile an iOS project to device with a Unity 3.2 Xcode 4 combination? I'm currently getting the following errors:

    Code (csharp):
    1.  
    2. Error building Player: Exception: Please make sure Xcode 3.1 including the iPhone SDK is installed.
    3. UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
    4.  
    5. Exception: Error building Player: Exception: Please make sure Xcode 3.1 including the iPhone SDK is installed.
    6. UnityEditor.BuildPlayerWindow.BuildPlayerWithDefaultSettings (Boolean askForBuildLocation, BuildOptions forceOptions)
    7. UnityEditor.BuildPlayerWindow.BuildPlayerAndRun ()
    8.  
    Which of course are rather bogus because Unity 3.1 worked with Xcode 3.2.5 just fine, and the above error is calling out for Xcode 3.1.

    <slight-panic>
    FYI, my Xcode 4 installation is at the default /Developer path because Apple is already recommending it over Xcode 3.2.5 (e.g., you can now use Xcode 4 to submit both iOS and OS X apps), which is why this error is a bit worrisome for those of us who plan to upgrade deploy fast. At some point Apple will release/require iOS 4.3 and I can only imagine it'll come with Xcode 4, at which point we'll be at a bit of dead end if this compilation failure is not addressed Unity-side.
    </slight-panic>

    So, after that little bit of panic out of the way, I proceed to ask the more civilized questions: has anyone gotten Unity 3.2 Xcode 4 to work together? Is this maybe an error particular to my box? That notwithstanding, does Unity 3.2 work with Xcode 3.2.5?

    Thanks for any information! Regards,


    - jmpp
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    I already built iOS programs with the first public preview of XCode 4 so unless apple F***ed something up considerably it should work with the release one too.

    That though won't be with iOS 4.3, that will be 4.4 or more likely 5.0 as I don't think that we will see another minor version on iOS 4

    Above error sounds like you potentially didn't install the real iPhone SDK but installed the xcode 4 goldmaster only .. cause with 3.2.5 and the 4.2 SDK it works fine.
     
  3. KnifeFightBob

    KnifeFightBob

    Joined:
    Jan 22, 2009
    Posts:
    196
    Yesterday I lost my iOS deployment virginity, and can say that 3.2.5 works very well with Unity. Reading the docs reveals that Unity recommends -not- using any beta SDKs, so I did not try Xcode 4.
     
  4. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    xcode 4 is not even beta sdk. the beta sdk is xcode 3.2.5 too

    the xcode beta is a completely distinct "branch" kind off that just happens to support the most current iphone sdk so it makes any sense to be present at all
     
  5. itech

    itech

    Joined:
    Jul 28, 2010
    Posts:
    139
    Hmmm I see that in Unity 3.2 is are only ARM 7 build options , but it's also written that is for iPad only , as I now iPhone 4 and iPad share same processor named A4, so whats the difference ?

    PS.
    I migrate my current project from Unity 3 to Unity 3.2 and for now everything works fine.
     
  6. jmpp

    jmpp

    Joined:
    Jun 1, 2010
    Posts:
    93
    Let me clarify things a bit.

    First off, I'm assuming people offering feedback here, downloading to iOS devices and everything, have agreed to Apple's NDA because otherwise they wouldn't have (legit) access to the SDKs, code signing resources, etc., so I'll proceed as if I'm not revealing any privileged information (which I posses only to the extent of the Apple's iOS Developer Program, since I'm not an Apple employee in any way). Now that having been said,...

    The current Xcode 4 build is at GM stage, which according to established lingo means it wont change much, if at all, until its final release, and that is why it is no longer a beta package and instead it is now being approved by Apple for App Stores (note the plural in Stores) submissions; that is also why it installs over /Developer, thus overriding any previous DevTools installation you might have had. More over, It does contain the iOS SDK package, as revealed by a simple ls in Terminal:


    -> ls /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
    total 0
    drwxr-xr-x 8 root wheel 272B Oct 27 03:32 iPhoneOS4.2.sdk/
    (and from thereon down the tree, I can confirm it is there)

    What I think all of the above is pointing to is that Xcode 4 iOS SDK 4.whatever or 5 Unity 3.x is a situation in which an increasing number of us will start seeing themselves sooner than later. The reason I think Xcode 4 will ship with iOS 4.3 (or whichever the next iOS release happens to be) is because I don't really think Apple will invest any time at all issuing a new Xcode 3.2.x iteration when they already have the radically different and much PR touted 4th release almost ready to go, overwriting everything at /Developer and what-not. But I might be wrong, of course.

    Now, if we are indeed gonna be stuck with Xcode 4 sooner than later, for good or bad, then I do think we do have a bit of a problem here, if my compilation failure is indeed not unique to my machine. Assuming the latter and if Unity was already working with previous releases of Xcode 4 (now that Dreamora mentions it, I do remember accidentally building to device once with one of the Xcode 4 preview builds), then it certainly means that either Apple changed something in the Xcode GM build or Unity in its 3.2 final release. Either way, I hardly see Apple issuing a fix for this issue that presumably many of us here will experience, so I'm guessing it'll have to come from Unity's side of the relationship.

    All of that out of the way already, one simple way to determine if the error is unique to my machine is if anyone could confirm a successful compilation to iOS device with a Unity 3.2 Xcode 4 GM combination. Anyone anyone? Buller? Buuullerr...? ;)

    Thanks for any feedback! Regards,


    - jmpp

    PS: Did that Ferris Buller reference just reveal at least how old I am? ;)
     
    Last edited: Feb 12, 2011
  7. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    For what it's worth, I'm trying out Xcode 4 with iOS SDK 4.2 in a few minutes to see if it fixes the problem ld has with linking Thumb and non-Thumb binaries. I will report back.
     
  8. jmpp

    jmpp

    Joined:
    Jun 1, 2010
    Posts:
    93
    Lastly, one almost-too-obvious-and-unncessary-thing I forgot to ask, but just to be on the mega-ultra-save side, is Unity 3.2.0f4 working with Xcode 3.2.5 (which thankfully I still have at the office) to compile download to iOS device?

    Thanks a bunch!


    - jmpp
     
  9. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    It's been working fine for me.
     
  10. jmpp

    jmpp

    Joined:
    Jun 1, 2010
    Posts:
    93
    Thanks for the confirmation Daniel, I'll feel safe upgrading to Unity 3.2 at the office now, cheers!


    - jmpp
     
  11. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    Xcode 4 seems to work fine as well. Make sure you get the latest seed, as it has the iOS SDK 4.2, whereas I believe earlier versions only included 4.3.

    Unfortunately, it doesn't fix the linker issue, so I'm back to 3.2.5 for superstition's sake. Also, I only just learned the current Xcode and don't have the time to puzzle through the new one.
     
  12. KnifeFightBob

    KnifeFightBob

    Joined:
    Jan 22, 2009
    Posts:
    196
    And just to ask it again: anyone have final results if Unity 3.2.0f4 works with Xcode 4 GM?
    EDIT: And there is was asked. Ignore me.
     
  13. jmpp

    jmpp

    Joined:
    Jun 1, 2010
    Posts:
    93
    I'm pleased to inform that I finally got my Unity 3.2 Xcode 4 setup working, I was able to build my iOS game and download it to device!

    For the sake of documentation I'll explain what I did, what I think triggered the error and how I corrected it:

    1. First off, I upgraded my project to Unity 3.2 and immediately changed the iOS SDK Version in Player settings to "iOS latest", rather than the explicit 4.2 SDK option (as it'd been before the Unity 3.2 upgrade).
    2. I Attempted a build through the File -> Build Run option, which appends to the existing Xcode project rather than creating a new one from scratch. This produced the error I described in my first post on this thread when attempting to download the game to my iOS device.
    3. After fiddling with many different options to no avail, I dediced to trash the existing Unity 3.1 generated Xcode project and attempt the build with a new one created from scratch by Unity 3.2, with an SDK Version of iOS 4.2 (explicit, not the "latest" option which currently happens to point to 4.2).
    4. Realizing the Xcode project generation had been successful this time round, I trashed it again and reattempted a regen but this time setting the SDK Version to "latest", which this time round did succeed.
    5. Having nailed that culprit, all the following Build Runs to append to the existing Xcode project (and compile download the resulting app to the device) have been successful so far, so I can safely say the problem is resolved and its cause identified.

    So, all in all, I would say that if prior to the Unity 3.2 upgrade your project is set to an explicit iOS release SDK in Player settings, don't change it to "latest" after you upgrade since that'll prevent it from building again, at least until you're ready to trash the existing Xcode project and regenerate it from scratch. This might not be a problem for many, whose tweaking of the Xcode project, if any, extend only to the code signing settings, which are easy to remember. If you on the other hand do modify the generated Xcode project, say for Facebook integration[1] or who knows what else, then I'd advise you to proceed with caution and leave the SDK setting intact until this problem of changing it to "latest" is investigated further. If you need to change the SDK to "latest", do so only after you're ready to trash the existging Xcode project and regen a new one from scratch with Unity 3.2.

    So, that having been resolved and explained, all I have left to say is "thanks for all the fish!" ;) Regards,


    - jmpp

    [1] I once read an article somewhere about integrating Unity created iOS games with Facebook through a technique which required shelling out some CocoaTouch/UIKit/ObjC code directly on the Unity generated Xcode project. If you do this or other similar stuff, trashing the Xcode project and starting afresh with a brand new one might not immediately be a viable option for you, so be careful!
     
  14. SilverFoxMedia

    SilverFoxMedia

    Joined:
    Nov 7, 2009
    Posts:
    153
    This was very helpful, thanks for posting that. :D
     
  15. drjest

    drjest

    Joined:
    Feb 10, 2009
    Posts:
    44
    jmpp, you probably had version f3 or earlier which gave that error. version f4 fixed it.
     
  16. jmpp

    jmpp

    Joined:
    Jun 1, 2010
    Posts:
    93
    No, for Unity 3.2 I never used anything prior to the f4 official/final release, downloaded right from http://unity3d.com/unity/download/


    - jmpp
     
  17. mindlube

    mindlube

    Joined:
    Oct 3, 2008
    Posts:
    993
    Unity 3.3 release notes sez XCode 4 is supported now!
     
  18. allarddijk

    allarddijk

    Joined:
    Aug 21, 2010
    Posts:
    8
    Installed Xcode 4 because of the 3.3 release note.
    However, my working Xcode 3 projects now crash in Xcode 4 !

    So please do not upgrade!