Search Unity

[Solved]Unity 5.1 Doesn't Works On OS X 10.11

Discussion in 'iOS and tvOS' started by QI, Jun 9, 2015.

  1. QI

    QI

    Joined:
    Oct 27, 2012
    Posts:
    229
    Hi there,
    I just switch to OS X 10.11 after the WWDC, when I run Unity, it is able to run but not able to build any game.
    When I build my game and target it to iOS , Unity shows me that :
    Screen Shot 2015-06-09 at 8.40.16 PM.png

    So I am not able to build my game, if any one have the same problem please share your solution, I am not able to build any game now. (It looks like a change of API in OS X that make Unity not able to run, wondering when if there is an update.)

    Thanks

    EDIT: Now I got a solution here, posted on down there.
     
    Last edited: Jun 9, 2015
  2. QI

    QI

    Joined:
    Oct 27, 2012
    Posts:
    229
    Plus : I am building for iOS
     
  3. Aurore

    Aurore

    Director of Real-Time Learning

    Joined:
    Aug 1, 2012
    Posts:
    3,106
    Is this the beta of El Capitan? Things are bound to be funky since it's not released yet.
     
  4. QI

    QI

    Joined:
    Oct 27, 2012
    Posts:
    229
    Yes.
    I have tried to build for a number of platforms and only iOS doesn't work.

    But I am not able to switch back to Yosemite, could you please launch a new version that support 10.11?
    I believe that many developers like me which updated to the beta of OS X will suffer this.

    Thanks
     
  5. QI

    QI

    Joined:
    Oct 27, 2012
    Posts:
    229
    Anyone here please help, :(:(:(
     
  6. Aurore

    Aurore

    Director of Real-Time Learning

    Joined:
    Aug 1, 2012
    Posts:
    3,106
    5.1f2 is still unreleased version of 5.1, can you download it from the site now http://unity3d.com/get-unity/download?ref=personal The full release being 5.1f3

    I can't guarantee this will work, since OSX 10.11 isn't even a public beta, it's usually not advisable to switch to beta software during development.
     
  7. QI

    QI

    Joined:
    Oct 27, 2012
    Posts:
    229
    Thanks you I will give this a try, hope it will work, come back here later :)
     
  8. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Abit of topic but if Unity plan to support El Capitan, please provide retina support and metal (If Adobe can do it so can Unity) not sure if Metal will provide Unity with a speed upgrade as rather slow app on Mac..
    Of course you rushed QI, how can Unity upgrade that quick..
     
  9. Aurore

    Aurore

    Director of Real-Time Learning

    Joined:
    Aug 1, 2012
    Posts:
    3,106
    That is totally off topic, but yes, we plan on supporting Metal and we are currently working on retina too.
     
  10. QI

    QI

    Joined:
    Oct 27, 2012
    Posts:
    229
    I wish if Unity support metal, it can enhance editor experience on Mac so we can works better :)
     
  11. Aurore

    Aurore

    Director of Real-Time Learning

    Joined:
    Aug 1, 2012
    Posts:
    3,106
    Please keep this topic focused on the issue, there is a thread in the discussion forum.
     
  12. QI

    QI

    Joined:
    Oct 27, 2012
    Posts:
    229
    Yeah I am trying to get the new version ready and give it a try.
     
  13. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,624
  14. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    We are looking into this issue. But it will take 1-2 weeks until fix reaches patch releases for various Unity versions.
    At the moment please try Alexey's workaround.
     
  15. QI

    QI

    Joined:
    Oct 27, 2012
    Posts:
    229
  16. QI

    QI

    Joined:
    Oct 27, 2012
    Posts:
    229
    Hi there again. I figure this thing out myself and wrote a simple code that would able to workaround:
    Code (CSharp):
    1. using UnityEditor;
    2. using UnityEngine;
    3.  
    4. public class BuildForiOS : MonoBehaviour {
    5.  
    6.     [MenuItem("File/Build For iOS (Development)")]
    7.     static void BuildForiOSDevelopment(){
    8.         //Get all scenes from build setting UI.
    9.         EditorBuildSettingsScene[] scenes = EditorBuildSettings.scenes;
    10.         string[] scenesPath = new string[scenes.Length];
    11.         for (int i = 0; i < scenesPath.Length; i++) scenesPath[i] = scenes[i].path;
    12.  
    13.         //Select where to save files
    14.         string previousPath = EditorPrefs.GetString ("BuildForiOS.PreviousPath", Application.persistentDataPath);
    15.         string destination = EditorUtility.SaveFilePanel ("Choose a destination", previousPath, EditorPrefs.GetString("BuildForiOS.Name",""), "");
    16.  
    17.         //Check if user canceled the action.
    18.         if (!string.IsNullOrEmpty (destination)) {
    19.             //Saving settings for the next build.
    20.             string name = destination.Substring(destination.LastIndexOf("/") + 1);
    21.             EditorPrefs.SetString ("BuildForiOS.PreviousPath", destination.Substring(0,destination.LastIndexOf("/")));
    22.             EditorPrefs.SetString("BuildForiOS.Name", name);
    23.  
    24.             //Build the player
    25.             BuildPipeline.BuildPlayer (scenesPath, destination, BuildTarget.iOS, BuildOptions.Development | BuildOptions.ShowBuiltPlayer | BuildOptions.Il2CPP);
    26.         }
    27.  
    28.     }
    29.  
    30. }
    This code performs a simple build action for iOS with development build and il2cpp option, you can custom it yourself.
    Hope this will help someone that faced the same problem like me.

    Notice : use this code to build a player will always replace your whole Xcode project, I didn't find any option for "append" currently.
     
    Last edited: Jun 10, 2015
    Atrixx and MrEsquire like this.
  17. jj-steele

    jj-steele

    Joined:
    Jul 24, 2012
    Posts:
    34
    Add
    BuildOptions.AcceptExternalModificationsToPlayer
    to the BuildPlayer and it will append.
     
  18. QI

    QI

    Joined:
    Oct 27, 2012
    Posts:
    229
    Thanks you very much, that works :)
     
  19. PhillippeC

    PhillippeC

    Joined:
    Jun 12, 2015
    Posts:
    5
    I have the same problem, but if I try the QI thing, I got an error:

    Assets/BuildForiOS.cs(1,7): error CS0246: The type or namespace name `UnityEditor' could not be found. Are you missing a using directive or an assembly reference?
    and
    Error building Player because scripts had compiler errors

    I hope that Unity will make a Update soon...
     
  20. QI

    QI

    Joined:
    Oct 27, 2012
    Posts:
    229
    Hi there ,I am not sure how you copy and pasted my code, but this code should not have any errors. And your error seems like the compiler could not find any namespace names "UnityEditor" which is definitely here. So I recommend you check your file carefully, you can try to create a empty file and paste the code the I have posted.

    I am sure this code works because I am using this code to build since i updated to 10.11.
     
  21. PhillippeC

    PhillippeC

    Joined:
    Jun 12, 2015
    Posts:
    5
    Thank QI for this fast answer!
    For the UnityEditor problem, I just had to put the script in a folder named Editor.
    Now, the script works...

    Thank
     
  22. QI

    QI

    Joined:
    Oct 27, 2012
    Posts:
    229
    Nice to hear that.
    Sorry about my answer didn't solve you problems directly, I always put scripts that is about editor into Editor folder so I almost forgot that editor script must in that folder. But it is nice that my script would able to help you :)
     
  23. ChronosD

    ChronosD

    Joined:
    Jul 16, 2015
    Posts:
    1
    Hi there,

    I couldn't make this work.. is this happening to everyone trying to make a build for iOS? Android works fine.
     
  24. QI

    QI

    Joined:
    Oct 27, 2012
    Posts:
    229
    Hey please try the new version 5.1.2, this error has been fixed in this version and is no longer needs my code :)
     
  25. DeepShader

    DeepShader

    Joined:
    May 29, 2009
    Posts:
    682
    Ok, so the latest version of Unity 5 works on the latest OS X 10.11 beta out of the box?
     
  26. QI

    QI

    Joined:
    Oct 27, 2012
    Posts:
    229
    yep
     
  27. DeepShader

    DeepShader

    Joined:
    May 29, 2009
    Posts:
    682
    Nice, is it possible to build Apps for iOS 8 for the store or only version 9 for testing?
     
  28. QI

    QI

    Joined:
    Oct 27, 2012
    Posts:
    229
    yes just as normal, from iOS 6.
    Of course it can build for release
     
  29. DeepShader

    DeepShader

    Joined:
    May 29, 2009
    Posts:
    682
    Ok, so I can install 10.11 beta and use an stable release of Xcode (not beta) to build for the App Store?
     
  30. QI

    QI

    Joined:
    Oct 27, 2012
    Posts:
    229
    I am not a Unity's internal member but follow my own experience Unity is work on 10.11 and work with Xcode 6.4 and newer version. And since 10.11 Beta 4 Xcode 6.4 can also launch, too. So there shouldn't be any problem if you upgrade to 10.11 now, but I am not sure if some future update of OS X beta or Unity will ruins currently situation that cause some problem.
     
  31. DeepShader

    DeepShader

    Joined:
    May 29, 2009
    Posts:
    682
    The important question is: Is it possible to build an App/Game on OS X 10.11 beta for the AppStore (you've to build with a stable release of Xcode to get accepted by Apple)
     
  32. QI

    QI

    Joined:
    Oct 27, 2012
    Posts:
    229
    For this time, yes.
     
  33. DeepShader

    DeepShader

    Joined:
    May 29, 2009
    Posts:
    682
    Thank you :)
     
  34. QI

    QI

    Joined:
    Oct 27, 2012
    Posts:
    229
    you're welcome :)
     
  35. Fcaldas

    Fcaldas

    Joined:
    Jul 6, 2015
    Posts:
    21
    Thanks, mate. Your script works perfectly. I am still on v5.1
    Do you know if upgrading to the latest 5.2.1 will solve the issue? Thanks!
     
  36. QI

    QI

    Joined:
    Oct 27, 2012
    Posts:
    229
    Yes it is completely solved :)