Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

nityException: Launching iOS project via Xcode4 failed

Discussion in 'iOS and tvOS' started by Moonjump, Mar 16, 2014.

  1. Moonjump

    Moonjump

    Joined:
    Apr 15, 2010
    Posts:
    2,572
    I was building my iOS project without problem a few days ago. I have added some small bits (5 simple models, amended some code and prefabs), but now a build fails. It opens Xcode then goes back to Unity and stays there, with the spinning beachball. Eventually it fails with the message:

    I checked the log, and the section below seems the relevant bit. The first 2 lines appear repeatedly, but I have only included the last few.

    I am using Unity 4.3.2, Xcode 5.1.

    Any suggestions?

    Code (csharp):
    1. Connecting to Xcode
    2. Disconnecting
    3. Connecting to Xcode
    4. Disconnecting
    5. Connecting to Xcode
    6. Disconnecting
    7. Waiting for plugin timed out
    8. 2014-03-16 19:32:40.084 Unity[505:707] Checking <NSRunningApplication: 0xe153d90 (com.apple.dt.Xcode - 602)>
    9. Connecting to Xcode
    10. Disconnecting
    11. Close all open unity project in Xcode failed. System.Net.Sockets.SocketException: Connection refused
    12.   at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy) [0x00000] in <filename unknown>:0
    13.   at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in <filename unknown>:0
    14.   at UnityEditor.iOS.Xcode4Controller.Connect () [0x00039] in /Applications/buildAgent/work/d3d49558e4d408f4/PlatformDependent/iPhonePlayer/Extensions/Managed/BuildPostProcessor.cs:53
    15.   at UnityEditor.iOS.Xcode4Controller.CloseAllOpenUnityProjects () [0x00006] in /Applications/buildAgent/work/d3d49558e4d408f4/PlatformDependent/iPhonePlayer/Extensions/Managed/BuildPostProcessor.cs:173
    16.   at UnityEditor.PostProcessiPhonePlayer.CloseUnityProjectsInXcode () [0x00005] in /Applications/buildAgent/work/d3d49558e4d408f4/PlatformDependent/iPhonePlayer/Extensions/Managed/BuildPostProcessor.cs:479
    17. Connecting to Xcode
    18. Disconnecting
    19. System.Net.Sockets.SocketException: Connection refused
    20.   at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy) [0x00000] in <filename unknown>:0
    21.   at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in <filename unknown>:0
    22.   at UnityEditor.iOS.Xcode4Controller.Connect () [0x00039] in /Applications/buildAgent/work/d3d49558e4d408f4/PlatformDependent/iPhonePlayer/Extensions/Managed/BuildPostProcessor.cs:53
    23.   at UnityEditor.iOS.Xcode4Controller.OpenProject (System.String path) [0x00006] in /Applications/buildAgent/work/d3d49558e4d408f4/PlatformDependent/iPhonePlayer/Extensions/Managed/BuildPostProcessor.cs:91
    24.   at UnityEditor.PostProcessiPhonePlayer.LaunchInXcode (BuildTarget target, System.String path) [0x0002a] in /Applications/buildAgent/work/d3d49558e4d408f4/PlatformDependent/iPhonePlayer/Extensions/Managed/BuildPostProcessor.cs:506
    25. UnityException: Launching iOS project via Xcode4 failed. Check editor log for details.
    26.  
    27. (Filename:  Line: -1)
    28.  
    29. System memory in use before: 95.7 MB.
    30. Unloading 72 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)
    31. System memory in use after: 86.6 MB.
    32.  
    33. Unloading 13 unused Assets to reduce memory usage. Loaded Objects now: 2099.
    34. Total: 58.529350 ms (FindLiveObjects: 0.095172 ms CreateObjectMapping: 0.057931 ms MarkObjects: 6.202006 ms  DeleteObjects: 0.143366 ms)
    35.  
    36. System memory in use before: 86.3 MB.
    37. Unloading 0 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)
    38. System memory in use after: 86.5 MB.
    39.  
    40. Unloading 0 unused Assets to reduce memory usage. Loaded Objects now: 2098.
    41. Total: 8.643686 ms (FindLiveObjects: 0.209528 ms CreateObjectMapping: 0.046842 ms MarkObjects: 8.327713 ms  DeleteObjects: 0.012043 ms)
    42.  
    43. - starting compile Library/ScriptAssemblies/Assembly-CSharp-firstpass.dll, for buildtarget 9
    44. System memory in use before: 86.4 MB.
    45. Unloading 1 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)
    46. System memory in use after: 86.5 MB.
    47.  
    48. Unloading 5 unused Assets to reduce memory usage. Loaded Objects now: 2098.
    49. Total: 11.547914 ms (FindLiveObjects: 0.367000 ms CreateObjectMapping: 0.318093 ms MarkObjects: 9.926044 ms  DeleteObjects: 0.559173 ms)
    50.  
    51.  
    52. *** Cancelled 'Build.Player.iPhonePlayer' in 54 seconds
     
    Last edited: Mar 16, 2014
  2. Moonjump

    Moonjump

    Joined:
    Apr 15, 2010
    Posts:
    2,572
    I tried a project I was working on last week, and now it is timing out also. I am not sure I had done a build since updating Xcode to 5.1. Are there any issues with the latest Xcode?
     
  3. Agent_007

    Agent_007

    Joined:
    Dec 18, 2011
    Posts:
    899
    At least in my machine with XCode 5.1 Build&Run doesn't run the project automatically.
     
  4. JFo

    JFo

    Joined:
    Dec 9, 2007
    Posts:
    217
    Yes, there are still problems with the latest xcode: the 'build and run' does not start the xcode build automatically. You have to start it manually.
    Hope they fix it someday....
     
  5. Moonjump

    Moonjump

    Joined:
    Apr 15, 2010
    Posts:
    2,572
    'Build And Run' was working fine on the recent version of Xcode I was using prior to 5.1

    The problem is I have no Xcode project created. Neither 'Build' nor 'Build And Run' are creating an Xcode project.

    'Build And Run' opens Xcode, but it immediately closes again.
     
  6. Moonjump

    Moonjump

    Joined:
    Apr 15, 2010
    Posts:
    2,572
    I have removed the Prime31 Game Center plugin I am using just in case. It has not solved the problem, but I noticed something appear that I have not seen before.

    A progress bar appeared along with Xcode opening, labelled "Deploying Player". It remained there at about 20% progress after Xcode closed, and stayed for long time while the spinning beach ball was showing. It only disappeared as Xcode opened again (showing the project selection screen) and the UnityException: Launching iOS project via Xcode4 failed appeared in the Unity console.
     
  7. DannyHellfish

    DannyHellfish

    Joined:
    Jan 20, 2014
    Posts:
    29
    I have the exact same problem. Nice to know I'm not the only one.
     
  8. Jb0

    Jb0

    Joined:
    Mar 18, 2014
    Posts:
    1
    Exact same problem here. Has to do something with the new version of Xcode. Very annoying.
     
  9. Moonjump

    Moonjump

    Joined:
    Apr 15, 2010
    Posts:
    2,572
    I have reverted to Xcode 5.0.2, which allows me to do builds again.

    To do that:
    Delete Xcode.
    Restart your Mac.
    Log into your developer account.
    At the bottom of the area for downloading Xcode 5.1, you will see a link asking if you are looking for an older version. Click on that and download the older version, then install.
     
  10. DannyHellfish

    DannyHellfish

    Joined:
    Jan 20, 2014
    Posts:
    29
    Thanks @moonjump for finding a temporary solution but the problem seems to be that with 5.0.2 you cannot develop on devices with the newest iOS version, can you? At least that was the reason I updated Xcode in the first place... I wonder why we are the only ones who seems to have this problem? Are we the only ones who updated Xcode :)
     
  11. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    You can fix Xcode 5.1 support by manually editing Unity Xcode plugin metadata.
    1. Find following file in Unity installation:
    2. Open it with text editor and locate following lines here:
    3. Insert following line just before closing </array>
    4. Restart Xcode.

    P.S. proper fix is scheduled for Unity 4.5.
     
    Last edited: Mar 20, 2014
  12. Moonjump

    Moonjump

    Joined:
    Apr 15, 2010
    Posts:
    2,572
    I have had a response to my bug report. It has been closed as a duplicate, so we are not the only ones. The following 2 options were given as workarounds, although I have not tested them as I am staying with 5.0.2 for the moment.

     
  13. seanbro

    seanbro

    Joined:
    Apr 25, 2013
    Posts:
    13
    This worked for me, but my "Info.plist" file was in a completely different location than you listed:

    /Applications/Unity/Unity.app/Contents/BuildTargetTools/iPhonePlayer/Unity4XC.xcplugin/Contents/Info.plist
     
  14. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Thanks for spotting it! I fixed my original post.
     
  15. DannyHellfish

    DannyHellfish

    Joined:
    Jan 20, 2014
    Posts:
    29
    Fixed it. Thanks!
     
  16. gtzpower

    gtzpower

    Joined:
    Jan 23, 2011
    Posts:
    318
    Thank you for the solution! This is probably the 3rd time this has happened to me after upgrading Xcode, and usually I just wait for a Unity update to resolve it. In an effort to not be held up by this issue again, I just wanted to document what I think is the solution for future Xcode updates here (for myself and others).

    I think the value Mantas recommended in step 3 comes from:
    Xcode.app/Contents/Info.plist

    Look for the DVTPluginCompatibilityUUID key and add its value into the plugin info like Mantas suggested.
     
  17. flyingaudio

    flyingaudio

    Joined:
    Dec 3, 2010
    Posts:
    98
    Thanks for this thread. I upgraded to Xcode 5.1 today and ran into the same issue. Mantas' solution worked.
     
  18. MRCty

    MRCty

    Joined:
    May 24, 2012
    Posts:
    31
    Mantas Puida solution works also for me with Unity 4.3.4 and xCode 5.1.1.
    MANY THANKS
     
  19. Hugooo

    Hugooo

    Joined:
    Mar 20, 2014
    Posts:
    5


    Thansks very much, that also works for me :)
     
  20. znoey

    znoey

    Joined:
    Oct 27, 2011
    Posts:
    174
    Editing the info.plist worked for me as well.
    Thanks a million.
     
  21. gordingin

    gordingin

    Joined:
    May 29, 2014
    Posts:
    4
    Sorry a little confused here. Is this the plist with the exported project or some other plist? If it is another one, not sure where that is. I have Unity on my Windows machine, I do an export to a NAS drive and have my MAC connect to it to compile. Where do I find this plist?

    thx
    Ralph
     
  22. gtzpower

    gtzpower

    Joined:
    Jan 23, 2011
    Posts:
    318
    The plist is inside the Unity application on your Mac. Right click on Unity, and "Show package contents", then browse to:
    Unity.app/Contents/BuildTargetTools/iPhonePlayer/Unity4XC.xcplugin/Contents/Info.plist
     
  23. bubz052

    bubz052

    Joined:
    Apr 20, 2013
    Posts:
    2
    For some reason after I build my project it crashes right after the splash screen. When I tried to locate my info.plist the iPhonePlayer folder was not there and I have built for iPhone many times before.

    I'm using:
    Unity 4.5.2f1
    Xcode 5.1.1
    OSX 10.9.4

    Thank you
     
  24. siradam

    siradam

    Joined:
    Jan 26, 2014
    Posts:
    6
    Just updated from Unity 4.3.4 to 4.5.3. Now when I build my XCode project and try to open it, I get "Unity-iPhone.xcodeproj cannot be opened because the project file cannot be parsed."

    If I go back to 4.3.4 to open the project and build the XCode project again, then I can open it just fine. What do I need to do to get my project to build properly for XCode in Unity 4.5.3?
     
  25. siradam

    siradam

    Joined:
    Jan 26, 2014
    Posts:
    6
    Using XCode 5.1.1, BTW. Also tried 6 beta with the same result.
     
  26. siradam

    siradam

    Joined:
    Jan 26, 2014
    Posts:
    6
    Discovered that after I build from Unity 4.5.3, I am getting an empty project.pbxproj file. I have no idea why.
     
  27. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    I now have this problem, Unity won't open and run Xcode since I've updated Xcode to 6.0, I have Unity 4.5.3f3 Pro.

    Any hot fix? or one on its way?
     
  28. doppelmonster

    doppelmonster

    Joined:
    Apr 11, 2013
    Posts:
    19
    same problem here. Unity 4.5.4f1 Free with Xcode 6.0

    I searched for the plist and found it at:
    /Applications/Unity/Unity.app/Contents/PlaybackEngines/iOSSupport/Tools/OSX/Unity4XC.xcplugin/Contents/Info.plist

    But Mantas fix is already in there:

    <key>DVTPlugInCompatibilityUUIDs</key>
    <array>
    <string>A2E4D43F-41F4-4FB9-BB94-7177011C9AED</string>
    <string>63FC1C47-140D-42B0-BB4D-A10B2D225574</string>
    <string>37B30044-3B14-46BA-ABAA-F01000C27B63</string>
    <string>AD68E85B-441B-4301-B564-A45E4919A6AD</string>
    </array>

    Any news?
     
  29. doppelmonster

    doppelmonster

    Joined:
    Apr 11, 2013
    Posts:
    19
  30. TonyE

    TonyE

    Joined:
    Oct 23, 2013
    Posts:
    4
    Copy DVTPlugInCompatibilityUUID in Xcode plist
    Add to DVTPlugInCompatibilityUUIDs array in Unity plist

    Unity plist : /Applications/Unity/Unity.app/Contents/PlaybackEngines/iOSSupport/Tools/OSX/Unity4XC.xcplugin/Contents/Info.plist

    Xcode plist : /Applications/Xcode.app/Contents/Info.plist

    restart unity, xcode and try again.

    Source:


    Hope that help.
     
    rjforbes and Tiddly_peeps like this.
  31. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    TonyE Thanks, that worked for me ..
     
  32. rjforbes

    rjforbes

    Joined:
    Mar 31, 2014
    Posts:
    3
    Thanks TonyE, This also works with Xcode 6.1 and Unity 4.5.4f1
     
  33. leftchannel

    leftchannel

    Joined:
    Feb 28, 2014
    Posts:
    25
    Confirmed to work with 4.6 final and XCode 6.1.
     
  34. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    That string is already in my Unity 4.5.5p1 and Unity4.6.1p4 plist. I'm running Xcode 6.1.1and I still get that error in xcode when building with both versions of Unity.
     
  35. Umai

    Umai

    Joined:
    Jun 18, 2013
    Posts:
    74
    Same error when running Unity 4.6.3p2 and Xcode 6.2. Guess it will be fixed in next Unity version... Still the error message is interesting because it says Xcode4 lul.
     
  36. hgbimonti

    hgbimonti

    Joined:
    Dec 31, 2008
    Posts:
    19
    Same here on 4.6.2f1 and Xcode 6.2. Please let us know if there's a quick fix. Thanks! ;)
     
  37. Deleted User

    Deleted User

    Guest

    same error occurring in Unity 4.6.3p3 and Xcode 6.2 "UnityException: Launching iOS project via Xcode4 failed. Check editor log for details."

     
  38. clockworkbird

    clockworkbird

    Joined:
    Mar 14, 2015
    Posts:
    1
    I am also getting this error: Unity 5 (and 4.6, 4.6.1) with XCode 6.2
    I tried the DVTPlugInCompatibilityUUID fixe listed above and it didn't work.
     
  39. Phaed

    Phaed

    Joined:
    Jul 20, 2014
    Posts:
    4
    I'm also getting this issue Unity 4.6.2f1 and XCode 6.2
     
  40. Phaed

    Phaed

    Joined:
    Jul 20, 2014
    Posts:
    4
    Updated to 4.6.3p3 with Xcode 6.2 and that fixed it.
     
  41. Xpbl4

    Xpbl4

    Joined:
    Nov 26, 2014
    Posts:
    1
    I'm use 4.6.3p3 with Xcode 6.2 and getting this error.

    But I fixed it.
    I updated DVTPlugInCompatibilityUUIDs with UUID: 'A16FF353-8441-459E-A50C-B071F53F51B7'
     
    Last edited: Mar 17, 2015
  42. PhaTeo

    PhaTeo

    Joined:
    Aug 29, 2013
    Posts:
    1
    TonyE great video. Worked for me Unity 4.5.5f1, Xcode 6.2 (6C131e), OS X Yossemite Version 10.10
     
  43. luvcraft

    luvcraft

    Joined:
    Aug 22, 2011
    Posts:
    72
    Hooray! That worked for me, too! Thank you!!! I'd been having this problem with Unity 4.6.3 and Xcode 6.2
     
  44. SoylentGraham

    SoylentGraham

    Joined:
    Nov 12, 2013
    Posts:
    46
    FYI, fix above works for Unity5 too. Location of the info.plist is slightly different...
    /Applications/Unity/Unity.app/Contents/PlaybackEngines/iOSSupport/Tools/OSX/Unity4XC.xcplugin/Contents/Info.plist

    XCode 6.2 guid is as above; A16FF353-8441-459E-A50C-B071F53F51B7

    Mantas/Unity, could there be a semi-automated solution, like adding the guid or some .app reference into unity preferences? (could also be useful for launching specific versions of xcode when I have multiple versions installed)
     
  45. Deleted User

    Deleted User

    Guest

    Thanks TonyE, this fixed the problem for us too. We agree with the other poster, it would be great if unity had an automated way to handle this.
     
  46. akasurreal

    akasurreal

    Joined:
    Jul 17, 2009
    Posts:
    442
    Using 4.6.4f1, still doesn't work with XCode 6.2.

    Had to manually add the GUID; A16FF353-8441-459E-A50C-B071F53F51B7
     
  47. povilas

    povilas

    Unity Technologies

    Joined:
    Jan 28, 2014
    Posts:
    427
  48. Wenamun

    Wenamun

    Joined:
    Jan 9, 2015
    Posts:
    14
    Welp, Xcode updated to 6.3 and now the game I was running and building just fine yesterday won't open in Xcode. Help?
     
  49. Wenamun

    Wenamun

    Joined:
    Jan 9, 2015
    Posts:
    14
    UPDATE: Okay, I managed to open one of the old builds in Xcode, but be forewarned, with the introduction of iOS 8.3 and Xcode 6.3 you might need to change your architectures or how they're built in Build Settings before your project will build properly.
     
  50. cryptoforge

    cryptoforge

    Joined:
    Jan 21, 2015
    Posts:
    60
    Can't get my projects to run with XCODE 6.3 and IOS 8.3. X_X