Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

5.2 : error building iOS

Discussion in '5.2 Beta' started by ababab5, Aug 23, 2015.

  1. ababab5

    ababab5

    Joined:
    Apr 15, 2014
    Posts:
    508
    Hi,

    I have this errors (work fine on Android) :

    Failed running /Applications/Unity/Unity.app/Contents/Frameworks/Tools/UnusedByteCodeStripper2/UnusedBytecodeStripper2.exe -out "/Volumes/LaCie/_AppAdvisory/NumbersAddictUnity/Temp/StagingArea/Data/Managed/tempStrip" -l none -c link -x "/Applications/Unity/Unity.app/Contents/Frameworks/Tools/UnusedByteCodeStripper/native_link.xml" -f "/Applications/Unity/Unity.app/Contents/Frameworks/il2cpp/LinkerDescriptors" -x "/Volumes/LaCie/_AppAdvisory/NumbersAddictUnity/Temp/StagingArea/Data/Managed/../platform_native_link.xml" -x "/Volumes/LaCie/_AppAdvisory/NumbersAddictUnity/Temp/StagingArea/Data/methods_pointedto_by_uievents.xml" -d "/Volumes/LaCie/_AppAdvisory/NumbersAddictUnity/Temp/StagingArea/Data/Managed" -a "/Volumes/LaCie/_AppAdvisory/NumbersAddictUnity/Temp/StagingArea/Data/Managed/Assembly-CSharp-firstpass.dll" -a "/Volumes/LaCie/_AppAdvisory/NumbersAddictUnity/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll" -a "/Volumes/LaCie/_AppAdvisory/NumbersAddictUnity/Temp/StagingArea/Data/Managed/Assembly-UnityScript.dll" -a "/Volumes/LaCie/_AppAdvisory/NumbersAddictUnity/Temp/StagingArea/Data/Managed/UnityEngine.UI.dll"

    stdout:
    ERROR: Failed to resolve base type System.Security.Principal.GenericIdentity for type System.Net.HttpListenerBasicIdentity
    Fatal error in Mono CIL Linker
    System.Exception: ERROR: Failed to resolve base type System.Security.Principal.GenericIdentity for type System.Net.HttpListenerBasicIdentity
    at UnusedBytecodeStripper2.ResolveFromMonoBehaviours.IsMonoBehaviourOrScriptableObject (Mono.Cecil.TypeDefinition type) [0x00000] in <filename unknown>:0
    at System.Linq.Enumerable+<CreateWhereIterator>c__Iterator1E`1[Mono.Cecil.TypeDefinition].MoveNext () [0x00000] in <filename unknown>:0
    at UnusedBytecodeStripper2.ResolveFromMonoBehaviours.Process (Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0
    at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0
    at Mono.Linker.Driver.Run () [0x00000] in <filename unknown>:0
    at Mono.Linker.Driver.RunDriver (Mono.Linker.Driver driver) [0x00000] in <filename unknown>:0
    stderr:

    UnityEngine.Debug:LogError(Object)
    UnityEditorInternal.Runner:RunManagedProgram(String, String, String, CompilerOutputParserBase) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:66)
    UnityEditorInternal.AssemblyStripper:RunAssemblyLinker(IEnumerable`1, String&, String&, String, String) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:192)
    UnityEditorInternal.AssemblyStripper:StripAssembliesTo(String, String, String&, String&, String, String, IEnumerable`1) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:185)
    UnityEditorInternal.AssemblyStripper:Strip(String, String, String&, String&, String, String, IEnumerable`1) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:136)
    UnityEditorInternal.AssemblyStripper:Strip(String[], String[], String, String, String&, String&, String, String, IEnumerable`1) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:121)
    UnityEditorInternal.IL2CPPBuilder:RunAssemblyStripper(IEnumerable, String, String[], String[], String) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:444)
    UnityEditorInternal.IL2CPPBuilder:StripAssemblies(IEnumerable`1, String) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:417)
    UnityEditorInternal.IL2CPPBuilder:Run() (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:291)
    UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:211)
    UnityEditor.HostView:OnGUI()


    ------

    AND :


    Exception: /Applications/Unity/Unity.app/Contents/Frameworks/Tools/UnusedByteCodeStripper2/UnusedBytecodeStripper2.exe did not run properly!
    UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:68)
    UnityEditorInternal.AssemblyStripper.RunAssemblyLinker (IEnumerable`1 args, System.String& out, System.String& err, System.String linkerPath, System.String workingDirectory) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:192)
    UnityEditorInternal.AssemblyStripper.StripAssembliesTo (System.String outputFolder, System.String workingDirectory, System.String& output, System.String& error, System.String linkerPath, System.String descriptorsFolder, IEnumerable`1 additionalBlacklist) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:185)
    UnityEditorInternal.AssemblyStripper.Strip (System.String outputFolder, System.String workingDirectory, System.String& output, System.String& error, System.String monoLinkerPath, System.String descriptorsFolder, IEnumerable`1 additionalBlacklist) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:136)
    UnityEditorInternal.AssemblyStripper.Strip (System.String[] assemblies, System.String[] searchDirs, System.String outputFolder, System.String workingDirectory, System.String& output, System.String& error, System.String monoLinkerPath, System.String descriptorsFolder, IEnumerable`1 additionalBlacklist) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:121)
    UnityEditorInternal.IL2CPPBuilder.RunAssemblyStripper (IEnumerable assemblies, System.String managedAssemblyFolderPath, System.String[] assembliesToStrip, System.String[] searchDirs, System.String monoLinkerPath) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:444)
    UnityEditorInternal.IL2CPPBuilder.StripAssemblies (IEnumerable`1 assemblies, System.String managedAssemblyFolderPath) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:417)
    UnityEditorInternal.IL2CPPBuilder.Run () (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:291)
    UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String tempFolder, System.String stagingAreaData, IIl2CppPlatformProvider platformProvider, System.Action`1 modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:211)
    UnityEditor.iOS.PostProcessiPhonePlayer.PostProcess (UnityEditor.iOS.iOSBuildPostprocessor pp, BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String stagingAreaDataManaged, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry)
    UnityEditor.iOS.iOSBuildPostprocessor.PostProcess (BuildPostProcessArgs args)
    UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, System.String downloadWebplayerUrl, System.String manualDownloadWebplayerUrl, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:316)
    UnityEditor.HostView:OnGUI()


    ----
    AND :

    Error building Player: Exception:
    /Applications/Unity/Unity.app/Contents/Frameworks/Tools/UnusedByteCodeStripper2/UnusedBytecodeStripper2.exe did not run properly!



    I'm on OS X.

    Thanks for your help!

    Best regards,

    AB
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,676
    Looks like one of your DLLs is referencing a type that's not available in the .NET profile you're trying to build with.

    Are you by any chance building with .NET profile set to "2.0 subset"?
     
    gregory_igromatic likes this.
  3. ababab5

    ababab5

    Joined:
    Apr 15, 2014
    Posts:
    508

    Hi,

    You right chef!

    Merci!

    But do you why it worked on 5.1 (.NET subset) and not in 5.2 ?

    Thanks !
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,676
    No idea. Maybe you got lucky, or maybe you the DLL in question didn't reference this particular type which is unavailable?
     
  5. ababab5

    ababab5

    Joined:
    Apr 15, 2014
    Posts:
    508
    It's still mystery.

    Thanks for your help !
     
  6. GuyTidhar

    GuyTidhar

    Joined:
    Jun 24, 2009
    Posts:
    320
    I am getting the same error now that I have upgraded to Unity 5.2.

    This happens even though I am using .NET 2.0 and not the subset.
     
  7. _secluder_

    _secluder_

    Joined:
    Jun 18, 2013
    Posts:
    10
    I'm also getting this error after upgrading to Unity 5.2.

    I did initially have my project set to ".NET 2.0 Subset" but even after I changed to ".NET 2.0", I'm still getting these errors trying to build for iOS.
     
  8. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @Tautvydas Zilys

    With my plugin I get this stripping error no matter what settings I use(.NET 2.0 or .NET 2.0 Subset, Strip Engine Code on or off). My plugin doesn't use these classes (directly, at least), and worked fine with Unity 5.1!
     
  9. alex-okita

    alex-okita

    Joined:
    May 16, 2013
    Posts:
    12
    Yes, I'm getting a new build error like the above with 5.2, but our plugin was working fine in 5.1.1 and 5.1.2 also 5.1.3. 5.2 broke our stuff. That's just no good.
     
  10. unity-nikkolai

    unity-nikkolai

    Joined:
    Sep 18, 2014
    Posts:
    540
    Do you still get the error if you disable the Strip Engine Code option in iOS Player Settings? Looks like it's enabled by default in Unity 5.2.
     
  11. _secluder_

    _secluder_

    Joined:
    Jun 18, 2013
    Posts:
    10
    Unfortunately, yes. Even if i disable Strip Engine Code, I get the same errors.
     
  12. alex-okita

    alex-okita

    Joined:
    May 16, 2013
    Posts:
    12
    thought i'd jump in too, I'm not working with the same dll/plug-in but I also tried disabling the strip engine code check box, and I still get the Failed running /UnusedBytecodeStripper2.exe error seems like a similar issue.
     
  13. unity-nikkolai

    unity-nikkolai

    Joined:
    Sep 18, 2014
    Posts:
    540
    I haven't been able to reproduce the issue locally. The settings I'm using are basically the defaults. I'm using the Unity Ads Helper as a test app with Unity Ads enable in the Unity 5.2 Services window (instead of using the Unity Ads asset package from the Asset Store).

    Key settings to check:
    • Scripting Backend = IL2CPP
    • Architecture = Universal
    • API Compatability Level = .NET 2.0 Subset
    • SDK Version = Device SDK
    • Script Call Optimization = Slow and Safe
    Configuration for iOS Player Settings that I'm using as follows:

    Screen Shot 2015-09-08 at 3.27.09 PM.png

    One other thing you might try is copying the Assets and ProjectSettings directories to a new directory and opening that directory as a project in Unity 5.2, allowing it to rebuild your Library and reimport all assets.
     
  14. ScientificMK

    ScientificMK

    Joined:
    May 15, 2014
    Posts:
    2
    Same problem here... Tried copying the entire project folder to a new one, deleted all .meta files, and open the project. This indeed imported all assets again but the error remains the same:

    Failed to resolve base type System.Security.Principal.GenericIdentity for type System.Net.HttpListenerBasicIdentity

    Any thoughts?
     
  15. _secluder_

    _secluder_

    Joined:
    Jun 18, 2013
    Posts:
    10
    None of the suggestions worked for me so I had to (painfully and regrettably) revert back to Unity 5.1.
     
  16. kobyle

    kobyle

    Joined:
    Feb 23, 2015
    Posts:
    92
    Same problem here, also tried everything that was suggested. :(
     
  17. Neogene

    Neogene

    Joined:
    Dec 29, 2010
    Posts:
    95
    Yes we have the same problem HOLY CRAP, we tried every tip without success, we are stuck! We went back to 5.1.
     
  18. Neogene

    Neogene

    Joined:
    Dec 29, 2010
    Posts:
    95
    We tried also removing culprit library without success.
     
  19. GuyTidhar

    GuyTidhar

    Joined:
    Jun 24, 2009
    Posts:
    320
    So did we. I suggest anyone to avoid this upgrade.
     
    kobyle likes this.
  20. aiko

    aiko

    Joined:
    Feb 2, 2013
    Posts:
    1
    I have the same problem. None of proposed solutions worked. What's even more interesting, our project doesn't use plugins, so I don't understand what part of program references System.Net.HttpListenerBasicIdentity.
     
  21. actraiser3

    actraiser3

    Joined:
    Sep 11, 2014
    Posts:
    28
    Just to add to the choir, I have the same problem when I switched from 5.1.3 to 5.2 that iOS building is not possible any more. Android works though. I tried exactly the settings shown in the screenshot by Nikkolai. I don't know how to to find DLLs which may or may not cause the error. What is the advised process to nail down the source of the problem?

    [Error] Failed running /Applications/Unity/Unity.app/Contents/Frameworks/Tools/UnusedByteCodeStripper2/UnusedBytecodeStripper2.exe -out "/Users/rxxxo/Unity/project/Temp/StagingArea/Data/Managed/tempStrip" -l none -c link -x "/Applications/Unity/Unity.app/Contents/Frameworks/Tools/UnusedByteCodeStripper/native_link.xml" -f "/Applications/Unity/Unity.app/Contents/Frameworks/il2cpp/LinkerDescriptors" -x "/Users/rxxxo/Unity/project/Temp/StagingArea/Data/Managed/../platform_native_link.xml" -x "/Users/rxxxo/Unity/project/Temp/StagingArea/Data/methods_pointedto_by_uievents.xml" -x "/Users/rxxxo/Unity/project/Assets/link.xml" -d "/Users/rxxxo/Unity/project/Temp/StagingArea/Data/Managed" -a "/Users/rxxxo/Unity/project/Temp/StagingArea/Data/Managed/Assembly-CSharp-firstpass.dll" -a "/Users/rxxxo/Unity/project/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll" -a "/Users/rxxxo/Unity/project/Temp/StagingArea/Data/Managed/Assembly-UnityScript.dll" -a "/Users/rxxxo/Unity/project/Temp/StagingArea/Data/Managed/UnityEngine.UI.dll" -a "/Users/rxxxo/Unity/project/Temp/StagingArea/Data/Managed/TouchScript.dll"
    stdout:

    Failed to resolve base type System.Security.Principal.GenericIdentity for type System.Net.HttpListenerBasicIdentity
    Fatal error in Mono CIL Linker
     
  22. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
  23. actraiser3

    actraiser3

    Joined:
    Sep 11, 2014
    Posts:
    28
    Okay, here is the solution:

    1. In Player Settings switch from IL2CPP to Mono in Scripting Backend
    2. Then find the now appeared dropdown "Stripping Level" and change it from "use Micro mscorlib" to "Strip Byte Code"
    3. Switch Back to IL2CPP in Scripting Backend

    iOS Compiles fine now.
     
  24. jlegrice

    jlegrice

    Joined:
    Nov 21, 2012
    Posts:
    6
    Was experiencing this- updating my Prime31 plugins (IAPCombo / etcetera / etcetera2) seemed to fix it.
     
    Last edited: Sep 9, 2015
  25. OriginalCoder

    OriginalCoder

    Joined:
    Jun 9, 2015
    Posts:
    4
    Thanks, this worked for me too.
     
    ScientificMK likes this.
  26. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,931
    We noticed this internally as well and merged a fix for it yesterday. The fix did not make the 5.2.0p1 cut-off, but it will be in 5.2.0p2. Until then, the workaround described by @actraiser3 is valid.
     
    theolagendijk likes this.
  27. ScientificMK

    ScientificMK

    Joined:
    May 15, 2014
    Posts:
    2
    This worked for me! Thanks a lot!
     
  28. Neogene

    Neogene

    Joined:
    Dec 29, 2010
    Posts:
    95
    Confirmed it works, but the compile throws an error (not blocking):

    NullReferenceException: Object reference not set to an instance of an object
    UnityEngine.UI.Graphic.OnRebuildRequested () (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Graphic.cs:399)
    UnityEngine.UI.GraphicRebuildTracker.OnRebuildRequested () (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/GraphicRebuildTracker.cs:33)
    UnityEngine.CanvasRenderer.RequestRefresh ()
     
  29. kobyle

    kobyle

    Joined:
    Feb 23, 2015
    Posts:
    92
    Wow this version full of bugs, crashing every minute... back to 5.1.3 thank god
     
  30. DevPz

    DevPz

    Joined:
    Sep 26, 2013
    Posts:
    6
    Hitting this with the recent release 5.2.0f3 :(
    I'm going to downgrade because it's blocking our development.
     
  31. Frederic Zindagi

    Frederic Zindagi

    Joined:
    Jun 11, 2015
    Posts:
    3
    Have you or anybody else seen problems with the Android deployment? Both a colleague and I moved to 5.2 and are unable to build a .apk, we're getting access errors about files in the Temp\StagingArea folder. Deleting Temp, rebooting, restarting Unity, didn't fix the issue, I had to go back to 5.1.3.
     
  32. nxtboyIII

    nxtboyIII

    Joined:
    Jun 4, 2015
    Posts:
    281
    Thanks, it works
     
  33. alternative_richie

    alternative_richie

    Joined:
    Sep 4, 2014
    Posts:
    15
    Yes, that worked for me too. However I now get Apple Mach-O Linker Error in XCode along with over 300 warnings. Back to 5.1.2p3. Can't waste any more time, not cool Unity.