5.2 : error building iOS

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 :0
at System.Linq.Enumerable+c__Iterator1E`1[Mono.Cecil.TypeDefinition].MoveNext () [0x00000] in :0
at UnusedBytecodeStripper2.ResolveFromMonoBehaviours.Process (Mono.Linker.LinkContext context) [0x00000] in :0
at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x00000] in :0
at Mono.Linker.Driver.Run () [0x00000] in :0
at Mono.Linker.Driver.RunDriver (Mono.Linker.Driver driver) [0x00000] in :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(IEnumerable1, 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, IEnumerable1) (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(IEnumerable1, 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 (IEnumerable1 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, IEnumerable1 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 (IEnumerable1 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

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"?

1 Like

Hi,

You right chef!

Merci!

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

Thanks !

No idea. Maybe you got lucky, or maybe you the DLL in question didn't reference this particular type which is unavailable?

It's still mystery.

Thanks for your help !

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.

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.

@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!

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.

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.

Unfortunately, yes. Even if i disable Strip Engine Code, I get the same errors.

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.

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:

2286511--153631--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.

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?

None of the suggestions worked for me so I had to (painfully and regrettably) revert back to Unity 5.1.

Same problem here, also tried everything that was suggested. :(

Yes we have the same problem HOLY CRAP, we tried every tip without success, we are stuck! We went back to 5.1.

We tried also removing culprit library without success.

[quote=“_secluder”, post:15, topic: 594709]
None of the suggestions worked for me so I had to (painfully and regrettably) revert back to Unity 5.1.
[/quote]

So did we. I suggest anyone to avoid this upgrade.

1 Like

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.